gnugzip

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: AGPL-3.0, GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package gnugzip is a pure-Go port of GNU gzip's compressor, producing the raw deflate streams that the gzip program writes.

The port (deflate.go, trees.go, bits.go) is derived from GNU gzip 1.14 and is licensed under the GNU General Public License version 3 or later; see COPYING in this directory. Its output is byte for byte what gzip 1.14 produces when reading a regular file, which differs from zlib's at most levels because gzip decides where to end a deflate block with its own heuristic and never emits a stored file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct{}

Engine produces raw deflate streams the way GNU gzip does.

func New

func New() *Engine

New returns the engine.

func (*Engine) Candidates

func (*Engine) Candidates(h *format.GzipHeader, _ int64) [][]engine.DeflateParams

Candidates returns two tiers: levels 1..9 ordered by the XFL hint, then the same levels with --rsyncable. GNU gzip has no level 0.

func (*Engine) Format

func (*Engine) Format() engine.Format

func (*Engine) Name

func (*Engine) Name() string

func (*Engine) NewWriter

func (*Engine) NewWriter(w io.Writer, p engine.DeflateParams) (io.WriteCloser, error)

NewWriter returns a writer that compresses into w. Close flushes.

func (*Engine) Version

func (*Engine) Version() string

Jump to

Keyboard shortcuts

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