diff options
author | n-peugnet <n.peugnet@free.fr> | 2021-08-31 16:28:07 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2021-08-31 16:38:34 +0200 |
commit | 504fe3db47c058807b656a8e63bb27c12420f268 (patch) | |
tree | 5fec35a147b3234633d237601cc49627fbedf331 /chunk.go | |
parent | c481eb2b44adf50b62de3b9e3355f64973967d52 (diff) | |
download | dna-backup-504fe3db47c058807b656a8e63bb27c12420f268.tar.gz dna-backup-504fe3db47c058807b656a8e63bb27c12420f268.zip |
join too small temp chunks with previous one if possible
Diffstat (limited to 'chunk.go')
-rw-r--r-- | chunk.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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...) +} |