MCPcopy
hub / github.com/klauspost/compress / fill

Method fill

zstd/bitreader.go:86–102  ·  view source on GitHub ↗

fill() will make sure at least 32 bits are available.

()

Source from the content-addressed store, hash-verified

84
85// fill() will make sure at least 32 bits are available.
86func (b *bitReader) fill() {
87 if b.bitsRead < 32 {
88 return
89 }
90 if b.cursor >= 4 {
91 b.cursor -= 4
92 b.value = (b.value << 32) | uint64(le.Load32(b.in, b.cursor))
93 b.bitsRead -= 32
94 return
95 }
96
97 b.bitsRead -= uint8(8 * b.cursor)
98 for b.cursor > 0 {
99 b.cursor -= 1
100 b.value = (b.value << 8) | uint64(b.in[b.cursor])
101 }
102}
103
104// finished returns true if all bits have been read from the bit stream.
105func (b *bitReader) finished() bool {

Callers 5

initMethod · 0.95
decodeMethod · 0.45
initMethod · 0.45
decodeSyncMethod · 0.45
nextMethod · 0.45

Calls 1

Load32Function · 0.92

Tested by

no test coverage detected