Documentation ¶
Overview ¶
Package bit implements bit level encoding wrappers for io.Reader / io.Writer All operations are Little Endian where applicable
Note that Write/Read operations do not return error for convenience, you must check bit.Reader.Error() or bit.Writer.Error() manually
Index ¶
- Constants
- func Count(x uint64) int
- func Read(r io.Reader, vs ...interface{}) error
- func Reverse(x uint64, width uint) (rx uint64)
- func ScanLeft(x uint64) uint
- func ScanRight(x uint64) uint
- func Write(w io.Writer, vs ...interface{}) error
- func ZDecode(ux uint64) int64
- func ZEncode(x int64) uint64
- type Reader
- type Writer
Constants ¶
View Source
const NotFound = 0xFF
Variables ¶
This section is empty.
Functions ¶
func ScanRight ¶
ScanRight scans from the highest to the lowest bit if x == 0 it will return NotFound
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (*Reader) Align ¶
func (r *Reader) Align()
Align aligns the reader to the next byte so that the next ReadBits will start reading a new byte from the underlying reader
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.