Xceed Zip Compression Library Documentation
Xceed Compression Format
Xceed Compression control reference > Xceed Compression Format

The Xceed Compression component uses a proprietary format when reading and writing compressed data.

The format is, however, simple and it is possible for third party applications and libraries to support it.

The format consists of a header, followed by the compressed, and possibly encrypted, data, followed by a footer.

The header is defined by the following C structure:

struct SCompressHeader
{
BYTE fcEncrypted : 1; // Indicates if the compressed data is encrypted
BYTE fcReserved : 3; // Reserved for future use
BYTE ecCompMethod : 4; // Compression method: 0=deflate, 1=store, 2=BWT
// 3=deflate64
// 4=BZip2
// 5=LZMA
// Followed by optional encryption header
};

Notice that sizeof( struct SCompressHeader ) is 1 byte. The members are bit fields:

The compressed data is the normal output of the selected compression method. Interoperability is possible here. For example, if deflate is used, the public domain ZLib Deflate algorithm can be used to read and write the compressed data.

When ecCompMethod is LZMA (5), the LZMA "end of stream marker" option is always used to compress the data.

If fcEncrypted is '1', the encryption used is the traditional PKWARE encryption as described in the Zip Specification (section VII).

The footer is a 4 byte Adler32 checksum of the uncompressed data.

There is no padding space between the header, compressed data and footer. The data in the header and footer is written in little-endian order.

Please note that this format is used by the Xceed Compression control. It is not used by the Xceed Zip control. Zip has its own openly documented file format.

The Xceed Compression file format can be read and written by the Xceed Zip for .NET component. The format is implemented in the Xceed.Compression.Formats.XceedCompressedStreamEx class.

See Also