The OpenD Programming Language

XzDecoder

A simple .xz file decoder.

See the constructor and processData docs for details.

You might prefer using decompressLzma for a higher-level api.

FIXME: it doesn't implement very many checks, instead assuming things are what it expects. Don't use this without assertions enabled!

Constructors

this
this(const(ubyte)[] initialData)

Start decoding by feeding it some initial data. You must send it at least enough bytes for the header (> 16 bytes prolly); try to send it a reasonably sized chunk.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

finished
bool finished()

Returns true after processData has finished decoding the compressed data.

needsMoreData
bool needsMoreData()

After calling processData, this will return true if more data is required to fill the destination buffer.

processData
ubyte[] processData(ubyte[] dest, ubyte[] src)

Continues an in-progress decompression of the src data, putting it into the dest buffer. The src data must be at least 20 bytes long, but I'd recommend making it at larger.

Variables

compressedSize
ulong compressedSize;
uncompressedSize
ulong uncompressedSize;
unprocessed
const(ubyte)[] unprocessed;

Meta