内容压缩支持对已压缩内容重新压缩

This commit is contained in:
GoEdgeLab
2021-10-18 16:50:06 +08:00
parent 91e82dde8e
commit 1a2681be03
9 changed files with 233 additions and 7 deletions

View File

@@ -0,0 +1,24 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package compressions
import (
"github.com/andybalholm/brotli"
"io"
)
type BrotliReader struct {
reader *brotli.Reader
}
func NewBrotliReader(reader io.Reader) (Reader, error) {
return &BrotliReader{reader: brotli.NewReader(reader)}, nil
}
func (this *BrotliReader) Read(p []byte) (n int, err error) {
return this.reader.Read(p)
}
func (this *BrotliReader) Close() error {
return nil
}