MCPcopy
hub / github.com/segmentio/kafka-go / readBytesWith

Function readBytesWith

read.go:129–142  ·  view source on GitHub ↗
(r *bufio.Reader, sz int, cb func(*bufio.Reader, int, int) (int, error))

Source from the content-addressed store, hash-verified

127}
128
129func readBytesWith(r *bufio.Reader, sz int, cb func(*bufio.Reader, int, int) (int, error)) (int, error) {
130 var err error
131 var n int
132
133 if sz, err = readArrayLen(r, sz, &n); err != nil {
134 return sz, err
135 }
136
137 if n > sz {
138 return sz, errShortRead
139 }
140
141 return cb(r, sz, n)
142}
143
144func readNewBytes(r *bufio.Reader, sz int, n int) ([]byte, int, error) {
145 var err error

Callers 3

readBytesWithMethod · 0.85
discardBytesFunction · 0.85
readBytesFunction · 0.85

Calls 1

readArrayLenFunction · 0.85

Tested by

no test coverage detected