class

Orc::RunLengthByteReader

Inherits Iterator < Enumerable < Reference < Object

The first byte of each group of values is a header that determines whether it is a run (value between 0 to 127) or literal list (value between -128 to -1). For runs, the control byte is the length of the run minus the length of the minimal run (3) and the control byte for literal lists is the negative length of the list. For example, a hundred 0’s is encoded as [0x61, 0x00] and the sequence 0x44, 0x45 would be encoded as [0xfe, 0x44, 0x45]. The next group can choose either of the encodings.

Constants

MAX_LITERAL_SIZE = 128
MIN_REPEAT_SIZE = 3

Constructors

new(io : IO)
Source

Instance methods

has_next?
Source
next

Returns the next element in this iterator, or Iterator::Stop::INSTANCE if there are no more elements.

Source
read
Source