go-xerial-snappy – github.com/eapache/go-xerial-snappy Index | Files

package snappy

import "github.com/eapache/go-xerial-snappy"

Index

Variables

var (

	// ErrMalformed is returned by the decoder when the xerial framing
	// is malformed
	ErrMalformed = errors.New("malformed xerial framing")
)

Functions

func Decode

func Decode(src []byte) ([]byte, error)

Decode decodes snappy data whether it is traditional unframed or includes the xerial framing format.

func DecodeInto

func DecodeInto(dst, src []byte) ([]byte, error)

DecodeInto decodes snappy data whether it is traditional unframed or includes the xerial framing format into the specified `dst`. It is assumed that the entirety of `dst` including all capacity is available for use by this function. If `dst` is nil *or* insufficiently large to hold the decoded `src`, new space will be allocated.

func Encode

func Encode(src []byte) []byte

Encode encodes data as snappy with no framing header.

func EncodeStream

func EncodeStream(dst, src []byte) []byte

EncodeStream *appends* to the specified 'dst' the compressed 'src' in xerial framing format. If 'dst' does not have enough capacity, then a new slice will be allocated. If 'dst' has non-zero length, then if *must* have been built using this function.

Source Files

snappy.go

Version
v0.0.0-20230731223053-c322873962e3 (latest)
Published
Jul 31, 2023
Platform
js/wasm
Imports
4 packages
Last checked
1 month ago

Tools for package owners.