Documentation
¶
Overview ¶
Package bitstream is a simple wrapper around a io.Reader and io.Writer to provide bit-level access to the stream.
Index ¶
- type Bit
- type BitReader
- func (b *BitReader) Align()
- func (b *BitReader) DumpAll() ([]byte, error)
- func (b *BitReader) GetReader() io.Reader
- func (b *BitReader) Read(dest []byte) error
- func (b *BitReader) ReadBit() (Bit, error)
- func (b *BitReader) ReadBits(nbits int) (uint64, error)
- func (b *BitReader) ReadByte() (byte, error)
- type BitWriter
- func (b *BitWriter) Align() error
- func (b *BitWriter) Flush(bit Bit) error
- func (b *BitWriter) Pending() (byt byte, vals uint8)
- func (b *BitWriter) Resume(data byte, count uint8)
- func (b *BitWriter) Write(data []byte) (int, error)
- func (b *BitWriter) WriteBit(bit Bit) error
- func (b *BitWriter) WriteBits(u uint64, nbits int) error
- func (b *BitWriter) WriteByte(byt byte) error
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
}
A BitReader reads bits from an io.Reader
func (*BitReader) ReadBit ¶
ReadBit returns the next bit from the stream, reading a new byte from the underlying reader if required.
type BitWriter ¶
type BitWriter struct {
// contains filtered or unexported fields
}
A BitWriter writes bits to an io.Writer
func NewWriter ¶
NewWriter returns a BitWriter that buffers bits and write the resulting bytes to 'w'
func (*BitWriter) WriteBit ¶
WriteBit writes a single bit to the stream, writing a new byte to 'w' if required.
Click to show internal directories.
Click to hide internal directories.