Make the rac codec per-chunk, not per-chunkWriter

This commit is contained in:
Nigel Tao committed 2019-08-08 14:39:18 +10:00
1 parent 2f1d6c77c9
commit fe2b4e236d
4 files changed
+34 -51

No files matched your search

+2 -4
View File
@@ -71,9 +71,8 @@ func Example_indexLocationAtEnd() {
buf := &bytes.Buffer{}
w := &rac.ChunkWriter{
Writer: buf,
Codec: rac.CodecZlib,
}
if err := w.AddChunk(uint64(len(src)), enc, 0, 0); err != nil {
if err := w.AddChunk(uint64(len(src)), enc, 0, 0, rac.CodecZlib); err != nil {
log.Fatalf("AddChunk: %v", err)
}
if err := w.Close(); err != nil {
@@ -102,7 +101,6 @@ func Example_indexLocationAtStart() {
buf := &bytes.Buffer{}
w := &rac.ChunkWriter{
Writer: buf,
Codec: rac.CodecZlib,
IndexLocation: rac.IndexLocationAtStart,
TempFile: &bytes.Buffer{},
}
@@ -143,7 +141,7 @@ func Example_indexLocationAtStart() {
}
encodedChunk := b.Bytes()
if err := w.AddChunk(uint64(len(chunk)), encodedChunk, dictResource, 0); err != nil {
if err := w.AddChunk(uint64(len(chunk)), encodedChunk, dictResource, 0, rac.CodecZlib); err != nil {
log.Fatalf("AddChunk: %v", err)
}