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

Function NewWriter

mem/buffer_slice.go:237–239  ·  view source on GitHub ↗

NewWriter wraps the given BufferSlice and BufferPool to implement the io.Writer interface. Every call to Write copies the contents of the given buffer into a new Buffer pulled from the given pool and the Buffer is added to the given BufferSlice.

(buffers *BufferSlice, pool BufferPool)

Source from the content-addressed store, hash-verified

235// buffer into a new Buffer pulled from the given pool and the Buffer is
236// added to the given BufferSlice.
237func NewWriter(buffers *BufferSlice, pool BufferPool) io.Writer {
238 return &writer{buffers: buffers, pool: pool}
239}
240
241// ReadAll reads from r until an error or EOF and returns the data it read.
242// A successful call returns err == nil, not err == EOF. Because ReadAll is

Callers 3

compressFunction · 0.92
ExampleNewWriterFunction · 0.92
ReadAllFunction · 0.85

Calls

no outgoing calls

Tested by 1

ExampleNewWriterFunction · 0.74