Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DecodeError ¶
type DecodeError struct {
Msg string
}
func (*DecodeError) Error ¶
func (e *DecodeError) Error() string
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder reads bits and bytes from an underlying buffer. Bit order within a byte is MSB-first (network order).
func NewDecoder ¶
func (*Decoder) AlignToByte ¶
func (d *Decoder) AlignToByte()
AlignToByte advances bitOffset to the next byte boundary (if needed), discarding any remaining bits in the current byte.
func (*Decoder) BitsRemaining ¶
BitsRemaining returns how many bits are left in the buffer.
type EncodeError ¶
type EncodeError struct {
Msg string
}
func (*EncodeError) Error ¶
func (e *EncodeError) Error() string
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder writes bits and bytes into an internal buffer. Bit order within a byte is MSB-first.
func NewEncoder ¶
func (*Encoder) AlignToByte ¶
func (e *Encoder) AlignToByte()
AlignToByte pads with zero bits to reach next byte boundary.
func (*Encoder) BitsWritten ¶
BitsWritten returns how many bits have been written.
func (*Encoder) WriteBytes ¶
WriteBytes writes a whole byte slice at the current byte-aligned position.
Click to show internal directories.
Click to hide internal directories.