Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidCount = errors.New("buffbits: read/write with invalid bit count")
ErrInvalidCount is the error used when a read/write occurs with a bit count that is too large or too small.
Functions ¶
This section is empty.
Types ¶
type Reader ¶ added in v0.2.0
type Reader struct {
// contains filtered or unexported fields
}
Reader implements buffered bit level read access from an underlying io.Reader. Buffered reading is powered by the bufio package. If an error occurs while reading from a Reader, no more data will be read and all subsequent calls will return an error.
func NewReaderSize ¶ added in v0.2.0
NewReaderSize creates a buffered bit reader reading from r using a buffer of size bytes.
func (*Reader) Err ¶ added in v0.2.0
Err returns the first error that was encountered by the Reader.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer implements buffered bit level write access to an underlying io.Writer. Buffered writing is powered by the bufio package. If an error occurs while writing to a Writer, no more data will be written and all subsequent calls will return an error. After all data has been written, the client should call Flush to guarantee all the data has been written to the underlying io.Writer.
func NewWriterSize ¶
NewWriterSize creates a buffered bit writer writing to w using a buffer of size bytes.