MCPcopy Create free account
hub / github.com/buger/jsonparser / peekByte

Method peekByte

reader_parser.go:609–619  ·  view source on GitHub ↗

peekByte returns the next byte. When retain is false, fully consumed chunks are discarded before reading more data. SYS-REQ-116

(retain bool)

Source from the content-addressed store, hash-verified

607// are discarded before reading more data.
608// SYS-REQ-116
609func (rp *ReaderParser) peekByte(retain bool) (byte, error) {
610 for rp.pos >= len(rp.buf) {
611 if !retain {
612 rp.discardConsumed()
613 }
614 if err := rp.readMore(); err != nil {
615 return 0, err
616 }
617 }
618 return rp.buf[rp.pos], nil
619}
620
621// SYS-REQ-116
622func (rp *ReaderParser) readMore() error {

Callers 10

ArrayEachMethod · 0.95
findValueMethod · 0.95
findObjectValueMethod · 0.95
findArrayValueMethod · 0.95
readObjectKeyMethod · 0.95
scanValueMethod · 0.95
scanStringMethod · 0.95
scanCompositeMethod · 0.95
scanScalarMethod · 0.95
skipWhitespaceMethod · 0.95

Calls 2

discardConsumedMethod · 0.95
readMoreMethod · 0.95

Tested by

no test coverage detected