From 504fe3db47c058807b656a8e63bb27c12420f268 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Tue, 31 Aug 2021 16:28:07 +0200 Subject: join too small temp chunks with previous one if possible --- chunk.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'chunk.go') diff --git a/chunk.go b/chunk.go index 78e689d..092b758 100644 --- a/chunk.go +++ b/chunk.go @@ -107,3 +107,11 @@ func (c *TempChunk) Reader() ChunkReader { func (c *TempChunk) Len() int { return len(c.value) } + +func (c *TempChunk) AppendFrom(r io.Reader) { + buff, err := io.ReadAll(r) + if err != nil { + println("Chunk: error appending to temp chunk:", err) + } + c.value = append(c.value, buff...) +} -- cgit v1.2.3