Lzlib 压缩库提供了在内存中的 LZMA 压缩和解压算法功能,包括对数据进行完整性检查。压缩格式是 lzip。
Lzlib is a data compression library providing in-memory LZMA compression and decompression functions, including integrity checking of the decompressed data. The compressed data format used by the library is the lzip format.
The functions and variables forming the interface of the compression library are declared in the file `lzlib.h'. Usage examples of the library are given in the files `main.cc' and `bbexample.cc' from the source distribution.
Compression/decompression is done by repeatedly calling a couple of read/write functions until all the data has been processed by the library. This interface is safer and less error prone than the traditional zlib interface.
Compression/decompression is done when the read function is called. This means the ">value returned by the position functions will not be updated until some data is read, even if you write a lot of data. If you want the data to be compressed in advance, just call the read function with a size equal to 0.
Lzlib will correctly decompress a data stream which is the concatenation of two or more compressed data streams. The result is the concatenation of the corresponding decompressed data streams. Integrity testing of concatenated compressed data streams is also supported.
All the library functions are thread safe. The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash even in case of corrupted input.
Lzlib implements a simplified version of the LZMA (Lempel-Ziv-Markov chain-Algorithm) algorithm. The original LZMA algorithm was designed by Igor Pavlov. For a description of the LZMA algorithm, see the Lzip manual.
Changes:
1. 压缩时间减少 2%.
2. All declarations not belonging to the API have been encapsulated in the namespace "Lzlib".
3. New tests have been added to the test suite....
4. Match length limits set by the options -1 to -9 of minilzip have been changed to match those of lzip 1.11.
5. Minilzip now sets stdin and stdout in binary mode on OS2.
6. The file bbexample.cc, containing example functions for buffer-to-buffer compression/decompression, has been added