MCPcopy
hub / github.com/tinylib/msgp / NewReader

Function NewReader

msgp/read.go:122–134  ·  view source on GitHub ↗

NewReader returns a *Reader that reads from the provided reader. The reader will be buffered.

(r io.Reader)

Source from the content-addressed store, hash-verified

120// reads from the provided reader. The
121// reader will be buffered.
122func NewReader(r io.Reader) *Reader {
123 p := readerPool.Get().(*Reader)
124 p.recursionDepth = 0
125 p.maxElements = 0
126 p.maxRecursionDepth = 0
127 p.maxStrLen = 0
128 if p.R == nil {
129 p.R = fwd.NewReader(r)
130 } else {
131 p.R.Reset(r)
132 }
133 return p
134}
135
136// NewReaderSize returns a *Reader with a buffer of the given size.
137// (This is vastly preferable to passing the decoder a reader that is already buffered.)

Callers 15

TestString_RoundTripFunction · 0.92
TestString_NilHandlingFunction · 0.92
TestString_EmptySetFunction · 0.92
TestInt_RoundTripFunction · 0.92
TestInt_NilHandlingFunction · 0.92
TestInt_EmptySetFunction · 0.92
TestIntSorted_RoundTripFunction · 0.92

Calls 1

ResetMethod · 0.45

Tested by 15

TestString_RoundTripFunction · 0.74
TestString_NilHandlingFunction · 0.74
TestString_EmptySetFunction · 0.74
TestInt_RoundTripFunction · 0.74
TestInt_NilHandlingFunction · 0.74
TestInt_EmptySetFunction · 0.74
TestIntSorted_RoundTripFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…