MCPcopy
hub / github.com/Terry-Mao/goim / Pop

Method Pop

pkg/bufio/bufio.go:156–163  ·  view source on GitHub ↗

Pop returns the next n bytes with advancing the reader. The bytes stop being valid at the next read call. If Pop returns fewer than n bytes, it also returns an error explaining why the read is short. The error is ErrBufferFull if n is larger than b's buffer size.

(n int)

Source from the content-addressed store, hash-verified

154// also returns an error explaining why the read is short. The error is
155// ErrBufferFull if n is larger than b's buffer size.
156func (b *Reader) Pop(n int) ([]byte, error) {
157 d, err := b.Peek(n)
158 if err == nil {
159 b.r += n
160 return d, err
161 }
162 return nil, err
163}
164
165// Discard skips the next n bytes, returning the number of bytes discarded.
166//

Callers 2

readFrameMethod · 0.80
ReadTCPMethod · 0.80

Calls 1

PeekMethod · 0.95

Tested by

no test coverage detected