aboutsummaryrefslogtreecommitdiff
path: root/chunk.go
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-09-02 15:04:05 +0200
committern-peugnet <n.peugnet@free.fr>2021-09-02 15:04:05 +0200
commit9387c79a1862e7572ffc59919c05cf1dc9aeeae5 (patch)
treed3e037378edacff40a242434ed1d3fe971051be3 /chunk.go
parent1dec2cdc84a6497c893d84485c6f94589f997215 (diff)
downloaddna-backup-9387c79a1862e7572ffc59919c05cf1dc9aeeae5.tar.gz
dna-backup-9387c79a1862e7572ffc59919c05cf1dc9aeeae5.zip
find similar chunks while matching stream
Diffstat (limited to 'chunk.go')
-rw-r--r--chunk.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/chunk.go b/chunk.go
index 3fc9057..abcdf1c 100644
--- a/chunk.go
+++ b/chunk.go
@@ -108,6 +108,10 @@ func (c *TempChunk) Len() int {
return len(c.value)
}
+func (c *TempChunk) Bytes() []byte {
+ return c.value
+}
+
func (c *TempChunk) AppendFrom(r io.Reader) {
buff, err := io.ReadAll(r)
if err != nil {
@@ -129,6 +133,7 @@ func (c *DeltaChunk) Reader() ChunkReader {
return &buff
}
+// TODO: Maybe return the size of the patch instead ?
func (c *DeltaChunk) Len() int {
return c.size
}