Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitReader ¶
type BitReader struct {
// contains filtered or unexported fields
}
BitReader wraps an io.Reader and provides the ability to read values, bit-by-bit, from it.
func New ¶
New creates a BitReader from an io.reader. It reads 'dataLength' bytes and stores them in an internal buffer.
func (*BitReader) ReadInt ¶
ReadInt reads an integer encoded on `bits' bits. for instance, given:
- the following stream: A8 E5 2B
- ReadInt(10)
10101000 11100101 00101011 \------- -/ 1010100011 -> -163 * First bit indicates a negative number * 010100011 means 163
func (*BitReader) ReadUintsBlock ¶
ReadUintsBlock reads a set of unsigned integer encoded on `bits' bits.
func (*BitReader) ResetOffset ¶
func (r *BitReader) ResetOffset()
ResetOffset reset the bit cursor to 0. The bit cursor is a value between 0 and 7 that point on the current bit to be read.
Click to show internal directories.
Click to hide internal directories.