xz

package module
v0.0.0-...-81bf2d4 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: BSD-3-Clause Imports: 5 Imported by: 18

Documentation

Overview

Package go-liblzma is a wrapper for liblzma and XZ file format.

Index

Constants

View Source
const DefaultBufsize = 32768

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action uint
const (
	// Continue coding.
	Run Action = iota
	// Make all the input available at output.
	SyncFlush
	// Finish encoding of the current Block.
	FullFlush
	// Finish the coding operation.
	Finish
)

type Checksum

type Checksum uint
const (
	CheckNone   Checksum = 0
	CheckCRC32  Checksum = 1
	CheckCRC64  Checksum = 4
	CheckSHA256 Checksum = 10
)

type Compressor

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

func NewWriter

func NewWriter(w io.Writer, preset Preset) (*Compressor, error)

func NewWriterCustom

func NewWriterCustom(w io.Writer, preset Preset, check Checksum, bufsize int) (*Compressor, error)

Initializes a XZ encoder with additional settings.

func (*Compressor) Close

func (enc *Compressor) Close() error

Frees any resources allocated by liblzma. It does not close the underlying reader.

func (*Compressor) Flush

func (enc *Compressor) Flush() error

func (*Compressor) Write

func (enc *Compressor) Write(in []byte) (n int, er error)

type Decompressor

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

func NewReader

func NewReader(r io.Reader) (*Decompressor, error)

func (*Decompressor) Close

func (r *Decompressor) Close() error

Frees any resources allocated by liblzma. It does not close the underlying reader.

func (*Decompressor) Read

func (r *Decompressor) Read(out []byte) (out_count int, er error)

type Errno

type Errno uint
const (
	// Operation completed successfully.
	Ok Errno = iota
	// End of stream was reached.
	StreamEnd
	// Input stream has no integrity check.
	NoCheck
	// Cannot calculate the integrity check.
	UnsupportedCheck
	// Integrity check type is now available.
	GetCheck
	// Cannot allocate memory.
	MemError
	// Memory usage limit was reached.
	MemlimitError
	// File format not recognized.
	FormatError
	// Invalid or unsupported options.
	OptionsError
	// Data is corrupt.
	DataError
	// No progress is possible.
	BufError
	// Programming error.
	ProgError
)

func (Errno) Error

func (e Errno) Error() string

type Preset

type Preset uint32
const (
	Level0 Preset = iota
	Level1
	Level2
	Level3
	Level4
	Level5
	Level6
	Level7
	Level8
	Level9
)
const (
	// Default compression preset.
	LevelDefault Preset = Level6
	// Extreme compression preset. To be OR'ed with another preset.
	LevelExtreme Preset = 1 << 31
	// Mask for preset level. To AND with a Preset to extract the level.
	LevelMask Preset = 0x1f
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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