aboutsummaryrefslogtreecommitdiff
path: root/compress.go
diff options
context:
space:
mode:
Diffstat (limited to 'compress.go')
-rw-r--r--compress.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/compress.go b/compress.go
index 6550c9e..f590d28 100644
--- a/compress.go
+++ b/compress.go
@@ -342,6 +342,15 @@ func (r *byteSliceReader) Read(p []byte) (int, error) {
return n, nil
}
+func (r *byteSliceReader) ReadByte() (byte, error) {
+ if len(r.b) == 0 {
+ return 0, io.EOF
+ }
+ n := r.b[0]
+ r.b = r.b[1:]
+ return n, nil
+}
+
func acquireStacklessDeflateWriter(w io.Writer, level int) stackless.Writer {
nLevel := normalizeCompressLevel(level)
p := stacklessDeflateWriterPoolMap[nLevel]