LzoChunk

LzoChunk compressor/decompressor

Chunk data layout if size_t has a width of 32-bit:

void[] chunk

chunk[0 .. 16] // header
chunk[16 .. $] // compressed data

Header data layout

chunk[0  ..  4] // length of chunk[4 .. $] (or compressed data length
                // + header length - 4)
chunk[4 ..   8] // 32-bit CRC value of following header elements and
                // compressed data (chunk[8 .. $]), calculated using
                //  lzo_crc32()
chunk[8  .. 12] // chunk/compression type code (signed 32-bit integer)
chunk[12 .. 16] // length of uncompressed data

Constructors

this
this()

Constructor - creates a new lzo instance internally.

this
this(Lzo lzo)

Constructor - sets this instance to use an lzo object passed externally (this allows multiple instances to use the same lzo object).

Members

Aliases

maxCompressedLength
alias maxCompressedLength = Lzo.maxCompressedLength

Static method alias, to be used as

Functions

compress
typeof(this) compress(void[] data, T[] compressed)

Compresses a data chunk

uncompress
typeof(this) uncompress(void[] compressed, T[] data)

Uncompresses a LZO chunk

Static functions

maxChunkLength
size_t maxChunkLength(size_t uncompressed_length)

Calculates the maximum chunk length from input data which has a length of uncompressed_length.

Variables

lzo_is_reference
bool lzo_is_reference;

Flag set to true if the lzo instance is a reference (ie was passed from the outside, is *not* owned by this instance, and should not be deleted in the destructor).

Meta