Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrShort = errors.New("deckcodec/bitio: unexpected EOF")
ErrShort is returned when there are not enough bytes left in the source to satisfy a read.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
Src []byte // Source byte slice to read from.
// contains filtered or unexported fields
}
Reader reads bits from a byte slice, accumulating bits in 'acc'. 'cur' tracks the current position in the source byte slice. 'nbits' is the number of bits currently in the accumulator.
func NewReader ¶
NewReader constructs a Reader with a known number of valid bits. If validBits < 0, all bits in src are considered valid (len(src)*8).
type Writer ¶
type Writer struct {
Buf []byte // Output buffer where bytes are written as they are completed.
// contains filtered or unexported fields
}
Writer is a bit-level writer that allows writing arbitrary numbers of bits into a byte buffer. The bits are accumulated in 'acc' until at least 8 bits are available, at which point a byte is flushed to 'Buf'.
Click to show internal directories.
Click to hide internal directories.