aboutsummaryrefslogtreecommitdiff
path: root/chunk.go
diff options
context:
space:
mode:
Diffstat (limited to 'chunk.go')
-rw-r--r--chunk.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/chunk.go b/chunk.go
index 9927c94..3fc9057 100644
--- a/chunk.go
+++ b/chunk.go
@@ -115,3 +115,20 @@ func (c *TempChunk) AppendFrom(r io.Reader) {
}
c.value = append(c.value, buff...)
}
+
+type DeltaChunk struct {
+ repo *Repo
+ source *ChunkId
+ patch []byte
+ size int
+}
+
+func (c *DeltaChunk) Reader() ChunkReader {
+ var buff bytes.Buffer
+ c.repo.Patcher().Patch(c.source.Reader(c.repo), &buff, bytes.NewReader(c.patch))
+ return &buff
+}
+
+func (c *DeltaChunk) Len() int {
+ return c.size
+}