MCPcopy Create free account
hub / github.com/chain/txvm / Read

Method Read

cmd/hex/main.go:55–72  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

53}
54
55func (r *splitLineReader) Read(p []byte) (int, error) {
56 if len(p) == 0 {
57 return 0, nil
58 }
59 p = p[:len(p)-1] // leave room for possible '\n' below
60 if len(p) > r.max-r.n {
61 p = p[:r.max-r.n]
62 }
63 n, err := r.r.Read(p)
64 p = p[:n]
65 r.n += n
66 if r.n >= r.max || err == io.EOF {
67 p = p[:n+1]
68 p[n] = '\n'
69 r.n = 0
70 }
71 return len(p), err
72}
73
74type decodeReader struct {
75 r io.Reader

Callers

nothing calls this directly

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected