2021-11-09 11:37:51 +00:00
|
|
|
//go:build cgo
|
2018-05-01 23:45:06 +00:00
|
|
|
// +build cgo
|
|
|
|
|
|
|
|
package h2mux
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
2018-07-24 23:04:33 +00:00
|
|
|
"github.com/cloudflare/brotli-go"
|
2018-05-01 23:45:06 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func CompressionIsSupported() bool {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
func newDecompressor(src io.Reader) *brotli.Reader {
|
|
|
|
return brotli.NewReader(src)
|
|
|
|
}
|
|
|
|
|
|
|
|
func newCompressor(dst io.Writer, quality, lgwin int) *brotli.Writer {
|
|
|
|
return brotli.NewWriter(dst, brotli.WriterOptions{Quality: quality, LGWin: lgwin})
|
|
|
|
}
|