MCPcopy Create free account
hub / github.com/weaveworks/scope / Read

Method Read

probe/plugins/max_bytes_reader.go:33–43  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

31}
32
33func (r *maxBytesReader) Read(p []byte) (int, error) {
34 if r.bytesRemaining <= 0 {
35 return 0, r.err
36 }
37 if int64(len(p)) > r.bytesRemaining {
38 p = p[0:r.bytesRemaining]
39 }
40 n, err := r.ReadCloser.Read(p)
41 r.bytesRemaining -= int64(n)
42 return n, err
43}

Callers 1

fileMethod · 0.45

Calls

no outgoing calls

Tested by 1

fileMethod · 0.36