xz

package module
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Unlicense Imports: 7 Imported by: 1

README

Xz

Package xz implements XZ decompression natively in Go. Documentation at:

https://pkg.go.dev/github.com/89z/xz.

If you need compression as well as decompression, you might want to look at https://github.com/ulikunitz/xz.

This Go package is a modified version of XZ Embedded http://tukaani.org/xz/embedded.html.

The contents of the testdata directory are modified versions of the test files from XZ Utils http://tukaani.org/xz/.

All the files in this package have been written by Michael Cross, Lasse Collin and/or Igor PavLov.

Method = LZMA2:23 CRC64
Method = LZMA2:23 NoCheck

Documentation

Index

Constants

View Source
const DefaultDictMax = 1 << 26 // 64 MiB

DefaultDictMax is the default maximum dictionary size in bytes used by the decoder. This value is sufficient to decompress files created with XZ Utils "xz -9".

Variables

This section is empty.

Functions

func NewReader

func NewReader(r io.Reader, dictMax uint32) (io.Reader, error)

NewReader creates a new reader reading from r. The decompressor will use an LZMA2 dictionary size up to dictMax bytes in size. Passing a value of zero sets dictMax to DefaultDictMax. If an individual XZ stream requires a dictionary size greater than dictMax in order to decompress, Read will return errMemlimit.

If NewReader is passed a value of nil for r then a reader is created such that all read attempts will return io.EOF. This is useful if you just want to allocate memory for a reader which will later be initialized with Reset.

Due to internal buffering, the reader may read more data than necessary from r.

Types

This section is empty.

Jump to

Keyboard shortcuts

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