MCPcopy Create free account
hub / github.com/dotabuff/manta / realign

Method realign

reader.go:142–146  ·  view source on GitHub ↗

realign discards the whole bytes the word refill buffered in the accumulator by rewinding the read position, so byte-oriented reads can proceed directly from (and alias) the underlying buffer. Only valid when byte-aligned, i.e. bitCount is a multiple of 8.

()

Source from the content-addressed store, hash-verified

140// from (and alias) the underlying buffer. Only valid when byte-aligned, i.e.
141// bitCount is a multiple of 8.
142func (r *reader) realign() {
143 r.pos -= r.bitCount >> 3
144 r.bitVal = 0
145 r.bitCount = 0
146}
147
148// readByte reads a single byte
149func (r *reader) readByte() byte {

Callers 2

readByteMethod · 0.95
readBytesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected