Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidGolombK is returned when the Golomb parameter k is invalid. ErrInvalidGolombK = errors.New("invalid golomb parameter k") // ErrInvalidEncodingParams is returned when encoding parameters are invalid. ErrInvalidEncodingParams = errors.New("invalid encoding parameters") )
Functions ¶
This section is empty.
Types ¶
type BitReader ¶
type BitReader struct {
// contains filtered or unexported fields
}
BitReader reads bits from an io.ByteReader.
func NewBitReader ¶
func NewBitReader(r io.ByteReader) *BitReader
NewBitReader creates a new BitReader on top of an io.ByteReader.
func (*BitReader) ReadBigIntBits ¶
ReadBigIntBits reads n bits and returns them as a big.Int.
type BitWriter ¶
type BitWriter struct {
// contains filtered or unexported fields
}
BitWriter writes bits to an io.Writer.
func NewBitWriter ¶
func NewBitWriter(w io.ByteWriter) *BitWriter
NewBitWriter creates a new BitWriter on top of an io.Writer. The underlying writer must support WriteByte (e.g., bufio.Writer).
func (*BitWriter) Flush ¶
Flush writes any pending bits to the underlying writer, padded with zeros.
func (*BitWriter) WriteBigIntBits ¶
WriteBigIntBits writes the n least significant bits of val, most significant first.
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder decodes integers using Golomb-Rice coding.
func NewDecoder ¶
func NewDecoder(r io.ByteReader, k int) *Decoder
NewDecoder creates a new decoder.
Click to show internal directories.
Click to hide internal directories.