class Orc::RunLengthByteReader

Overview

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.

Included Modules

Defined in:

orc/run_length_byte_reader.cr

Constant Summary

MAX_LITERAL_SIZE = 128
MIN_REPEAT_SIZE = 3

Constructors

Instance Method Summary

Constructor Detail

def self.new(io : IO) #

[View source]

Instance Method Detail

def has_next? #

[View source]
def next #
Description copied from module Iterator(UInt8)

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


[View source]
def read #

[View source]