class HexaPDF::Utils::BitStreamReader


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

Alias for: append_data

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

Also aliased as: <<

Reads bits number of bits.

Returns nil if not enough bits are available for reading.


Returns true if bits number of bits can be read.


Returns the number of remaining bits that can be read.