MCPcopy Create free account
hub / github.com/egonelbre/exp / flush

Method flush

bit/bit.go:21–37  ·  view source on GitHub ↗

flush writes as much full bytes as possible to the underlying writer

()

Source from the content-addressed store, hash-verified

19
20// flush writes as much full bytes as possible to the underlying writer
21func (w *Writer) flush() {
22 if w.err != nil {
23 w.nbits = 0
24 return
25 }
26
27 var buf [16]byte
28 n := 0
29 for w.nbits > 8 {
30 buf[n] = byte(w.bits)
31 w.bits >>= 8
32 w.nbits -= 8
33 n++
34 }
35
36 _, w.err = w.w.Write(buf[0:n])
37}
38
39// flushAll writes all the remaining half bytes
40func (w *Writer) flushAll() {

Callers 2

flushAllMethod · 0.95
WriteBitsMethod · 0.95

Implementers 1

writerhtmlrender/dom/html.go

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected