blob: e23bfc4772f7771c62cce2cc8b7ef4da6b1a1c07 [file] [log] [blame]
package sarama
import (
"github.com/klauspost/compress/zstd"
)
var (
zstdDec, _ = zstd.NewReader(nil)
zstdEnc, _ = zstd.NewWriter(nil, zstd.WithZeroFrames(true))
)
func zstdDecompress(dst, src []byte) ([]byte, error) {
return zstdDec.DecodeAll(src, dst)
}
func zstdCompress(dst, src []byte) ([]byte, error) {
return zstdEnc.EncodeAll(src, dst), nil
}