lzmaCompress

fnubyte[] lzmaCompress(const(ubyte)[] data, int level = cast(int) LZMA_PRESET_DEFAULT)

One-shot compression of data using LZMA/XZ.

Allocates the output buffer automatically. For repeated compressions, prefer using a LzmaCompressor instance.

Parameters

dataThe data to compress.
levelCompression preset level (0..9, default: LZMA_PRESET_DEFAULT).

Returns

The compressed .xz data as a new buffer.

Throws

LzmaException if compression fails.