CompressMemory()

Syntax

Result = CompressMemory(*Buffer, Size, *Output, OutputSize [, Plugin [, Level]])
Description
Compress the buffer content into the output buffer. The output buffer length needs to be at least as long as the buffer to compress.

Parameters

*Buffer The memory buffer to compress.
Size The size of the memory to compress.
*Output The memory buffer to store the compressed data.
OutputSize The memory buffer size to store the compressed data.
Plugin (optional) The plugin to use, if more than one packer plugin has been registered. It can be one of the following value:
  #PB_PackerPlugin_BriefLZ: use the BriefLZ packer to compress the memory. UseBriefLZPacker() has to be called to register the plugin.
  #PB_PackerPlugin_Zip    : use the Zip packer to compress the memory. UseZipPacker() has to be called to register the plugin.
  #PB_PackerPlugin_Lzma   : use the Lzma packer to compress the memory. UseLzmaPacker() has to be called to register the plugin.
Level (optional) The compression level to use. It is an integer value ranging from 0 (lower compression ratio, faster compression) to 9 (higher compression ratio, slower compression).

Return value

Return the compressed size if the buffer has been successfully compressed, zero otherwise. If the buffer data can't be compressed (already compressed data generally don't compress anymore), it will return zero.

See Also

UncompressMemory()

Supported OS

All

<- ClosePack() - Packer Index - CreatePack() ->