Documentation ¶
Overview ¶
Package snappy implements the snappy block-based compression format. It aims for very high speeds and reasonable compression.
The C++ snappy implementation is at http://code.google.com/p/snappy/
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCorrupt reports that the input is invalid. ErrCorrupt = errors.New("snappy: corrupt input") // ErrUnsupported reports that the input isn't supported. ErrUnsupported = errors.New("snappy: unsupported input") )
Functions ¶
func Decode ¶
Decode returns the decoded form of src. The returned slice may be a sub- slice of dst if dst was large enough to hold the entire decoded block. Otherwise, a newly allocated slice will be returned. It is valid to pass a nil dst.
func DecodedLen ¶
DecodedLen returns the length of the decoded block.
func Encode ¶
Encode returns the encoded form of src. The returned slice may be a sub- slice of dst if dst was large enough to hold the entire encoded block. Otherwise, a newly allocated slice will be returned. It is valid to pass a nil dst.
func MaxEncodedLen ¶
MaxEncodedLen returns the maximum length of a snappy block, given its uncompressed length.
Types ¶
type Reader ¶ added in v0.3.2
type Reader struct {
// contains filtered or unexported fields
}
Reader is an io.Reader than can read Snappy-compressed bytes.
func NewReader ¶ added in v0.3.2
NewReader returns a new Reader that decompresses from r, using the framing format described at https://code.google.com/p/snappy/source/browse/trunk/framing_format.txt
type Writer ¶ added in v0.3.2
type Writer struct {
// contains filtered or unexported fields
}
Writer is an io.Writer than can write Snappy-compressed bytes.
func NewWriter ¶ added in v0.3.2
NewWriter returns a new Writer that compresses to w, using the framing format described at https://code.google.com/p/snappy/source/browse/trunk/framing_format.txt