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)
| 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. |
| 497 | func (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. |