MCPcopy
hub / github.com/pquerna/ffjson / ReadByte

Method ReadByte

fflib/v1/buffer.go:334–343  ·  view source on GitHub ↗

ReadByte reads and returns the next byte from the buffer. If no byte is available, it returns error io.EOF.

()

Source from the content-addressed store, hash-verified

332// ReadByte reads and returns the next byte from the buffer.
333// If no byte is available, it returns error io.EOF.
334func (b *Buffer) ReadByte() (c byte, err error) {
335 if b.off >= len(b.buf) {
336 // Buffer is empty, reset to recover space.
337 b.Truncate(0)
338 return 0, io.EOF
339 }
340 c = b.buf[b.off]
341 b.off++
342 return c, nil
343}
344
345// ReadRune reads and returns the next UTF-8-encoded
346// Unicode code point from the buffer.

Callers 2

scanReadByteMethod · 0.45
readByteMethod · 0.45

Calls 1

TruncateMethod · 0.95

Tested by

no test coverage detected