Merge merges the provided Buffer with this one. The other Buffer will be appended to v, and other will be empty after this operation completes.
(other *Buffer)
| 484 | // The other Buffer will be appended to v, and other will be empty after this |
| 485 | // operation completes. |
| 486 | func (b *Buffer) Merge(other *Buffer) { |
| 487 | b.data.PushBackList(&other.data) |
| 488 | other.data = ViewList{} |
| 489 | |
| 490 | // Adjust sizes. |
| 491 | b.size += other.size |
| 492 | other.size = 0 |
| 493 | } |
| 494 | |
| 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. |