type block … type bitReader … // makeBitReader makes a bit reader starting at off. func (r *Reader) makeBitReader(data block, off int) bitReader { … } // moreBits is called to read more bits. // This ensures that at least 16 bits are available. func (br *bitReader) moreBits() error { … } // val is called to fetch a value of b bits. func (br *bitReader) val(b uint8) uint32 { … } // backup steps back to the last byte we used. func (br *bitReader) backup() { … } // makeError returns an error at the current offset wrapping a string. func (br *bitReader) makeError(msg string) error { … } type reverseBitReader … // makeReverseBitReader makes a reverseBitReader reading backward // from off to start. The bitstream starts with a 1 bit in the last // byte, at off. func (r *Reader) makeReverseBitReader(data block, off, start int) (reverseBitReader, error) { … } // val is called to fetch a value of b bits. func (rbr *reverseBitReader) val(b uint8) (uint32, error) { … } // fetch is called to ensure that at least b bits are available. // It reports false if this can't be done, // in which case only rbr.cnt bits are available. func (rbr *reverseBitReader) fetch(b uint8) bool { … } // makeError returns an error at the current offset wrapping a string. func (rbr *reverseBitReader) makeError(msg string) error { … }