class

CrImage::JPEG::BitReader

Inherits Reference / Object

BitReader for reading bits from an IO stream Handles JPEG byte stuffing (0xFF 0x00 sequences)

Constructors

new(io : IO)
Source

Instance methods

align_to_byte

Align to byte boundary by discarding remaining bits

Source
available_bits
Source
ensure_available_bits(n : Int32) : Bool
Source
finish
Source
peek_bits(n : Int32) : Int32
Source
read_bit

Read a single bit from the stream

Source
read_bits(n : Int32) : UInt16

Read n bits from the stream as a UInt16 n must be between 1 and 16

Source
saved_marker
Source
skip_bits(n : Int32) : Nil
Source