class HexaPDF::Utils::BitStreamReader

Parent

Helper class for reading variable length integers from a bit stream.

This class allows one to read integers with a variable width from a bit stream using the read method. The data from where these bits are read, can be set on intialization and additional data can later be appended.

Public Class Methods

new(data = +'')

Creates a new object, optionally providing the string from where the bits should be read.

Public Instance Methods

<<(str)
Alias for: append_data
append_data(str)

Appends some data to the string from where bits are read.

Also aliased as: <<
read(bits)

Reads bits number of bits.

Returns nil if not enough bits are available for reading.

read?(bits)

Returns true if bits number of bits can be read.

remaining_bits()

Returns the number of remaining bits that can be read.