MCPcopy
hub / github.com/grpc/grpc-go / Reset

Method Reset

mem/buffer_slice.go:150–156  ·  view source on GitHub ↗

Reset frees the currently held buffer slice and starts reading from the provided slice. This allows reusing the reader object.

(s BufferSlice)

Source from the content-addressed store, hash-verified

148// Reset frees the currently held buffer slice and starts reading from the
149// provided slice. This allows reusing the reader object.
150func (r *Reader) Reset(s BufferSlice) {
151 r.data.Free()
152 s.Ref()
153 r.data = s
154 r.len = s.Len()
155 r.bufferIdx = 0
156}
157
158// Close frees the underlying BufferSlice and never returns an error. Subsequent
159// calls to Read will return (0, io.EOF).

Callers 3

doWithMaxSizeMethod · 0.95
DoMethod · 0.45

Implementers 3

conncredentials/alts/internal/conn/record.
nonBlockingReaderinternal/transport/readyreader/ready_r
blockingReaderinternal/transport/readyreader/ready_r

Calls 3

FreeMethod · 0.65
RefMethod · 0.65
LenMethod · 0.65

Tested by 1