compress

package
v1.21.10 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: Zlib Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ZstdLevel = 1 // fastest

ZstdLevel compression level used by Zstd

Variables

This section is empty.

Functions

func NewReader added in v1.8.68

func NewReader(_ []byte, _ uint64, readers []io.ReadCloser) (io.ReadCloser, error)

NewReader returns a new bzip2 io.ReadCloser.

Types

type Compressor

type Compressor interface {
	Name() string
	CompressBound(int) int
	Compress(dst, src []byte) (int, error)
	Decompress(dst, src []byte) (int, error)
}

func NewCompressor

func NewCompressor(level string) Compressor

type LZ4

type LZ4 struct{}

func (LZ4) Compress

func (l LZ4) Compress(dst, src []byte) (int, error)

Compress using LZ4 algorithm

func (LZ4) CompressBound

func (l LZ4) CompressBound(size int) int

CompressBound max size of compressed data

func (LZ4) Decompress

func (l LZ4) Decompress(dst, src []byte) (int, error)

Decompress using LZ4 algorithm

func (LZ4) Name

func (l LZ4) Name() string

Name returns name of the algorithm LZ4

type ZStandard

type ZStandard struct {
	// contains filtered or unexported fields
}

ZStandard implements Compressor interface using zstd library

func (ZStandard) Compress

func (n ZStandard) Compress(dst, src []byte) (int, error)

Compress using Zstd

func (ZStandard) CompressBound

func (n ZStandard) CompressBound(l int) int

CompressBound max size of compressed data

func (ZStandard) Decompress

func (n ZStandard) Decompress(dst, src []byte) (int, error)

Decompress using Zstd

func (ZStandard) Name

func (n ZStandard) Name() string

Name returns name of the algorithm Zstd

Jump to

Keyboard shortcuts

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