close the bitstream and returns an error if out-of-buffer reads occurred.
()
| 118 | |
| 119 | // close the bitstream and returns an error if out-of-buffer reads occurred. |
| 120 | func (b *bitReader) close() error { |
| 121 | // Release reference. |
| 122 | b.in = nil |
| 123 | b.cursor = 0 |
| 124 | if !b.finished() { |
| 125 | return fmt.Errorf("%d extra bits on block, should be 0", b.remain()) |
| 126 | } |
| 127 | if b.bitsRead > 64 { |
| 128 | return io.ErrUnexpectedEOF |
| 129 | } |
| 130 | return nil |
| 131 | } |
| 132 | |
| 133 | func highBits(val uint32) (n uint32) { |
| 134 | return uint32(bits.Len32(val) - 1) |
no test coverage detected