base: github.com/grailbio/base/compress/zstd Index | Files

package zstd

import "github.com/grailbio/base/compress/zstd"

Index

Package Files

zstd_cgo.go

func CompressLevel Uses

func CompressLevel(scratch []byte, in []byte, level int) ([]byte, error)

Compress compresses the given source data. Scratch can be passed to prevent prevent allocation. If it is too small, or if nil is passed, a new buffer will be allocated and returned. Arg level specifies the compression level. level < 0 means the default compression level.

func Decompress Uses

func Decompress(scratch []byte, in []byte) ([]byte, error)

Decompress uncompresses the given source data. Scratch can be passed to prevent allocation. If it is too small, or if nil is passed, a new buffer will be allocated and returned.

func NewReader Uses

func NewReader(r io.Reader) (io.ReadCloser, error)

NewReader creates a ReadCloser that uncompresses data. The returned object must be Closed after use.

func NewWriter Uses

func NewWriter(w io.Writer) (io.WriteCloser, error)

NewWriter creates a WriterCloser that compresses data. The returned object must be Closed after use.

Package zstd imports 2 packages (graph) and is imported by 2 packages. Updated 2019-09-20. Refresh now. Tools for package owners.