MCPcopy Index your code
hub / github.com/google/gvisor / WriteFromReader

Method WriteFromReader

pkg/buffer/buffer.go:497–499  ·  view source on GitHub ↗

WriteFromReader writes to the buffer from an io.Reader. A maximum read size of MaxChunkSize is enforced to prevent allocating views from the heap.

(r io.Reader, count int64)

Source from the content-addressed store, hash-verified

495// WriteFromReader writes to the buffer from an io.Reader. A maximum read size
496// of MaxChunkSize is enforced to prevent allocating views from the heap.
497func (b *Buffer) WriteFromReader(r io.Reader, count int64) (int64, error) {
498 return b.WriteFromReaderAndLimitedReader(r, count, nil)
499}
500
501// WriteFromReaderAndLimitedReader is the same as WriteFromReader, but
502// optimized to avoid allocations if a LimitedReader is passed in.

Callers 7

TestReadFromLargeWriterFunction · 0.95
DeepCloneMethod · 0.95
writeMethod · 0.95
WriteMethod · 0.95
fillWriteFromReaderFunction · 0.80
fillWriteFromReaderEndFunction · 0.80

Calls 1

Tested by 3

TestReadFromLargeWriterFunction · 0.76
fillWriteFromReaderFunction · 0.64
fillWriteFromReaderEndFunction · 0.64