MCPcopy Create free account
hub / github.com/brimdata/super / ReadByte

Method ReadByte

pkg/peeker/reader.go:92–103  ·  view source on GitHub ↗

ReadByte implements io.ByteReader.ReadByte.

()

Source from the content-addressed store, hash-verified

90
91// ReadByte implements io.ByteReader.ReadByte.
92func (r *Reader) ReadByte() (byte, error) {
93 if len(r.cursor) > 0 {
94 b := r.cursor[0]
95 r.cursor = r.cursor[1:]
96 return b, nil
97 }
98 buf, err := r.Read(1)
99 if err != nil {
100 return 0, err
101 }
102 return buf[0], nil
103}

Callers 5

TokenMethod · 0.45
readLiteralMethod · 0.45
readNumberMethod · 0.45
readStringMethod · 0.45
GenByteFunction · 0.45

Calls 1

ReadMethod · 0.95

Tested by

no test coverage detected