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

Method Read

reader_parser_test.go:234–246  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

232}
233
234func (r *repeatedByteReader) Read(p []byte) (int, error) {
235 if r.remaining == 0 {
236 return 0, io.EOF
237 }
238 if int64(len(p)) > r.remaining {
239 p = p[:r.remaining]
240 }
241 for i := range p {
242 p[i] = r.value
243 }
244 r.remaining -= int64(len(p))
245 return len(p), nil
246}
247
248type fixedChunkReader struct {
249 data []byte

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected