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)
| 235 | // buffer into a new Buffer pulled from the given pool and the Buffer is |
| 236 | // added to the given BufferSlice. |
| 237 | func 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 |
no outgoing calls