Documentation ¶
Overview ¶
Package bitreader provides basic interfaces to read and traverse an io.Reader as a stream of bits, rather than a stream of bytes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aligner ¶
Aligner is the interface that allows for byte realignment.
IsAligned() returns true if the bit stream is currently aligned to a byte boundary.
Align() will skip the necessary bit to realign the bit stream to a byte boundary. It returns the number of bits skipped (0 <= n < 8) during realignment.
type Peeker ¶
Peeker is the interface that wraps the basic Peek1 method
Peek1 will return true or false depending on whether or not the next bit in the bit stream is set; it does not advance the stream any bits.
type Peeker32 ¶
Peeker32 is the interface that wraps the basic Peek32 method.
Peek32 allows for reading multiple bits, where (1 <= n <= 32) as a uint32 from the bit stream; it does not advance the bit stream any bits.
type Reader ¶
Reader1 is the interface that wraps the basic Read1 method
Read1() will return true or false depending on whether or not the next bit in the bit stream is set, then advance one bit forward in the bit-stream.
Read1() is the equivalent to Peek1() followed by Skip(1)
type Reader32 ¶
Reader32 is the interface that wraps the basic Read32 method.
Read32 allows for reading multiple bits, where (1 <= n <= 32) as a uint32 from the bit stream. Then advancing the bit stream by n bits.
Read32(n) is equivalent to Peek32(n) followed by Skip(n)