lzma

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package lzma decompresses data with C-lzma library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int

Action used by Stream.Code.

const (
	Run         Action = iota // continue coding
	SyncFlush                 // make all the input available at output
	FullFlush                 // finish encoding of the current block
	Finish                    // finish the coding operation
	FullBarrier               // finish encoding of the current block
)

type DecoderOpt

type DecoderOpt int32

A DecoderOpt can be passed in when initializing a decoder.

const (
	TellNoCheck          DecoderOpt = 1 << iota // enables NoCheck
	TellUnsupportedCheck                        // enables UnsupportedCheck
	TellAnyCheck                                // enables GetCheck
	Concatenated                                // enables concatenated file support
	IgnoreCheck                                 // disables DataError for invalid integrity checks. Since liblzma 5.1.4beta
	FailFast                                    // enables eagerly returning errors in threaded decoding. Since liblzma 5.3.3alpha
)

type Return

type Return int

Return values used by several functions in liblzma.

const (
	Ok               Return = iota // operation completed successfully
	StreamEnd                      // end of stream was reached.
	NoCheck                        // input stream has no integrity check
	UnsupportedCheck               // cannot calculate the integrity check
	GetCheck                       // integrity check type is now available
	MemError                       // cannot allocate memory
	MemLimitError                  // memory usage limit was reached
	FormatError                    // file format not recognized
	OptionsError                   // invalid or unsupported options
	DataError                      // data is corrupt
	BufError                       // no progress is possible
	ProgError                      // programming error
	SeekNeeded                     // request to change the input file position
)

type Stream

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

func NewStreamDecoder

func NewStreamDecoder(memlimit uint64, flags ...DecoderOpt) (*Stream, error)

NewStreamDecoder initializes an .xz Stream configured as a decoder.

func (*Stream) AvailableIn

func (stream *Stream) AvailableIn() int

func (*Stream) AvailableOut

func (stream *Stream) AvailableOut() int

func (*Stream) Close added in v0.2.0

func (stream *Stream) Close() error

Close frees memory allocated for the coder data structures used internally.

func (*Stream) Code

func (stream *Stream) Code(action Action) Return

Code encodes or decodes data based on how the Stream has been initialized, and it's current state as set by Stream.SetNextIn and Stream.SetNextOut.

func (*Stream) SetNextIn

func (stream *Stream) SetNextIn(in []byte)

func (*Stream) SetNextOut

func (stream *Stream) SetNextOut(out []byte)

Jump to

Keyboard shortcuts

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