flate

package
v0.0.0-...-77e5a9a Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: BSD-2-Clause, BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEncoder

func NewEncoder() pack.Encoder

func NewGZIPEncoder

func NewGZIPEncoder() pack.Encoder

func NewGZIPWriter

func NewGZIPWriter(w io.Writer, level int) *pack.Writer

NewGZIPWriter returns a new pack.Writer that compresses data at the given level, in gzip encoding. Levels 1–9 are available; levels outside this range will be replaced by the closest level available.

func NewMatchFinder

func NewMatchFinder(level int) pack.MatchFinder

func NewWriter

func NewWriter(w io.Writer, level int) *pack.Writer

NewWriter returns a new pack.Writer that compresses data at the given level, in flate encoding. Levels 1–9 are available; levels outside this range will be replaced with the closest level available.

Types

type BestSpeed

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

BestSpeed is an implementation of the MatchFinder interface that is comparable to level 1 (BestSpeed) in compress/flate.

func (*BestSpeed) FindMatches

func (q *BestSpeed) FindMatches(dst []pack.Match, src []byte) []pack.Match

FindMatches looks for matches in src, appends them to dst, and returns dst.

func (*BestSpeed) Reset

func (q *BestSpeed) Reset()

type DualHash

type DualHash struct {
	// Set Lazy to true to enable "lazy matching".
	Lazy bool
	// contains filtered or unexported fields
}

DualHash is a modified version of BestSpeed with higher compression but lower speed. It uses both a 4-byte hash and an 8-byte one.

func (*DualHash) FindMatches

func (q *DualHash) FindMatches(dst []pack.Match, src []byte) []pack.Match

FindMatches looks for matches in src, appends them to dst, and returns dst.

func (*DualHash) Reset

func (q *DualHash) Reset()

Jump to

Keyboard shortcuts

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