mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 08:55:11 +01:00
Remove the rac.ReaderContext type
This commit is contained in:
1 parent
65e7b2b6c9
commit
cde91019d9
5 files changed
+47
-69
No files matched your search
@@ -21,19 +21,17 @@ import (
|
||||
"io"
|
||||
|
||||
"github.com/google/wuffs/lib/compression"
|
||||
"github.com/google/wuffs/lib/rac"
|
||||
)
|
||||
|
||||
// MakeDecompressor implements rac.CodecReader.
|
||||
func (r *CodecReader) MakeDecompressor(compressed io.Reader, rctx rac.ReaderContext) (io.Reader, error) {
|
||||
func (r *CodecReader) makeDecompressor(compressed io.Reader, dict []byte) (io.Reader, error) {
|
||||
if r.cachedReader != nil {
|
||||
if err := r.cachedReader.Reset(compressed, rctx.Secondary); err != nil {
|
||||
if err := r.cachedReader.Reset(compressed, dict); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return r.cachedReader, nil
|
||||
}
|
||||
|
||||
zlibReader, err := zlib.NewReaderDict(compressed, rctx.Secondary)
|
||||
zlibReader, err := zlib.NewReaderDict(compressed, dict)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user