snappy

package
v2.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewS2

func NewS2() compress.Interface

Initialize a new S2 object based on the Interface interface

func NewSnappy

func NewSnappy() compress.Interface

Initialize a new Snappy object based on the Interface interface

Types

type S2

type S2 struct{}

func (S2) Decode

func (s S2) Decode(v *bytes.Buffer)

The Decode method will first decode and then overwrite the data in the input *bytes.Buffer.

func (S2) Encode

func (s S2) Encode(v []byte) (*bytes.Buffer, error)

Encode compresses the given bytes using S2 compression, returning the compressed data in a new bytes.Buffer.

type Snappy

type Snappy struct{}

func (Snappy) Decode

func (s Snappy) Decode(v *bytes.Buffer)

The Decode method will first decode and then overwrite the data in the input *bytes.Buffer.

func (Snappy) Encode

func (s Snappy) Encode(v []byte) (*bytes.Buffer, error)

Encode compresses the given bytes using Snappy compression, returning the compressed data in a new bytes.Buffer.

Snappy only has the advantage of compression speed, and its compression ratio is ridiculously low. This compression engine is not recommended under normal circumstances and it causes additional overhead.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL