Documentation
¶
Index ¶
- Constants
- func AcquireFlateReader(r io.Reader) (io.ReadCloser, error)
- func AcquireGzipReader(r io.Reader) (*gzip.Reader, error)
- func AcquireStacklessDeflateWriter(w io.Writer, level int) stackless.Writer
- func AcquireStacklessGzipWriter(w io.Writer, level int) stackless.Writer
- func AppendDeflateBytes(dst, src []byte) []byte
- func AppendDeflateBytesLevel(dst, src []byte, level int) []byte
- func AppendGunzipBytes(dst, src []byte) ([]byte, error)
- func AppendGzipBytes(dst, src []byte) []byte
- func AppendGzipBytesLevel(dst, src []byte, level int) []byte
- func AppendInflateBytes(dst, src []byte) ([]byte, error)
- func GunzipData(p []byte) ([]byte, error)
- func InflateData(p []byte) ([]byte, error)
- func IsFileCompressible(f *os.File, minCompressRatio float64) bool
- func ReleaseFlateReader(zr io.ReadCloser)
- func ReleaseGzipReader(zr *gzip.Reader)
- func ReleaseStacklessDeflateWriter(sw stackless.Writer, level int)
- func ReleaseStacklessGzipWriter(sw stackless.Writer, level int)
- func ResetFlateReader(zr io.ReadCloser, r io.Reader) error
- func WriteDeflate(w io.Writer, p []byte) (int, error)
- func WriteDeflateLevel(w io.Writer, p []byte, level int) (int, error)
- func WriteGunzip(w io.Writer, p []byte) (int, error)
- func WriteGzip(w io.Writer, p []byte) (int, error)
- func WriteGzipLevel(w io.Writer, p []byte, level int) (int, error)
- func WriteInflate(w io.Writer, p []byte) (int, error)
Constants ¶
const ( CompressNoCompression = flate.NoCompression CompressBestSpeed = flate.BestSpeed CompressBestCompression = flate.BestCompression CompressDefaultCompression = 6 // flate.DefaultCompression CompressHuffmanOnly = -2 // flate.HuffmanOnly )
Supported compression levels.
Variables ¶
This section is empty.
Functions ¶
func AcquireFlateReader ¶
func AcquireFlateReader(r io.Reader) (io.ReadCloser, error)
func AppendDeflateBytes ¶
AppendDeflateBytes appends deflated src to dst and returns the resulting dst.
func AppendDeflateBytesLevel ¶
AppendDeflateBytesLevel appends deflated src to dst using the given compression level and returns the resulting dst.
Supported compression levels are:
- CompressNoCompression
- CompressBestSpeed
- CompressBestCompression
- CompressDefaultCompression
- CompressHuffmanOnly
func AppendGunzipBytes ¶
AppendGunzipBytes appends gunzipped src to dst and returns the resulting dst.
func AppendGzipBytes ¶
AppendGzipBytes appends gzipped src to dst and returns the resulting dst.
func AppendGzipBytesLevel ¶
AppendGzipBytesLevel appends gzipped src to dst using the given compression level and returns the resulting dst.
Supported compression levels are:
- CompressNoCompression
- CompressBestSpeed
- CompressBestCompression
- CompressDefaultCompression
- CompressHuffmanOnly
func AppendInflateBytes ¶
AppendInflateBytes appends inflated src to dst and returns the resulting dst.
func GunzipData ¶
func InflateData ¶
func ReleaseFlateReader ¶
func ReleaseFlateReader(zr io.ReadCloser)
func ReleaseGzipReader ¶
func ResetFlateReader ¶
func ResetFlateReader(zr io.ReadCloser, r io.Reader) error
func WriteDeflate ¶
WriteDeflate writes deflated p to w and returns the number of compressed bytes written to w.
func WriteDeflateLevel ¶
WriteDeflateLevel writes deflated p to w using the given compression level and returns the number of compressed bytes written to w.
Supported compression levels are:
- CompressNoCompression
- CompressBestSpeed
- CompressBestCompression
- CompressDefaultCompression
- CompressHuffmanOnly
func WriteGunzip ¶
WriteGunzip writes ungzipped p to w and returns the number of uncompressed bytes written to w.
func WriteGzip ¶
WriteGzip writes gzipped p to w and returns the number of compressed bytes written to w.
func WriteGzipLevel ¶
WriteGzipLevel writes gzipped p to w using the given compression level and returns the number of compressed bytes written to w.
Supported compression levels are:
- CompressNoCompression
- CompressBestSpeed
- CompressBestCompression
- CompressDefaultCompression
- CompressHuffmanOnly
Types ¶
This section is empty.