Reactive RunLength Encoding

In this post, we’ll look at a reactive solution for the Run Length Encoding problem, which is summarized (on Wikipedia) as:

A form of lossless data compression in which runs of data (that is, sequences in which the same data value occurs in many consecutive data elements) are stored as a single data value and count, rather than as the original run.

The challenge here is to perform it in a Reactive way using Reactor operators. Let’s jump in!

update 2018-03-13: Found a few shortcomings of the first implementation and added two new sections that present alternatives.