compress

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode

type Mode uint8

Mode is the compression mode

const (
	Zstd Mode = 0
	None Mode = 1
)

Data compression modes

func FromUint8

func FromUint8(v uint8) (Mode, error)

FromUint8 converts a uint8 to a compression mode. Returns an error if the value is an unknown mode.

func (Mode) AsUint8

func (m Mode) AsUint8() uint8

AsUint8 converts a compression mode to a uint8.

func (Mode) Compress

func (m Mode) Compress(src []byte) ([]byte, error)

Compress compresses src, appends it to dst, and returns the updated dst slice.

func (Mode) DecompressStream

func (m Mode) DecompressStream(dst io.Writer, src io.Reader) error

DecompressStream decompresses data from src and writes it to dst.

Jump to

Keyboard shortcuts

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