e-CryptIt Engine - Compression Xojo Plugin |
|
LZMA2 Class (console safe)
LZMA2 is built on LZMA. The LZMA2 encoder processes the input in chunks (of up to 2 MB uncompressed size or 64 KB compressed size, whichever is lower), handing each chunk to the LZMA encoder, and then deciding whether to output an LZMA2 LZMA chunk including the encoded data, or to output an LZMA2 uncompressed chunk, depending on which is shorter (LZMA, like any other compressor, will necessarily expand rather than compress some kinds of data).
The LZMA state is reset only in the first block, if the caller requests a change of properties and every time a compressed chunk is output. The LZMA properties are changed only in the first block, or if the caller requests a change of properties. The dictionary is only reset in the first block.
The LZMA implementation extracted from 7-Zip is available as LZMA SDK. It was originally dual-licensed under both the GNU LGPL and Common Public License,[13] with an additional special exception for linked binaries, but was placed by Igor Pavlov in the public domain on December 2, 2008, with the release of version 4.62.
Properties
AllowYield | If set to true then the plugin will yield to Xojo threads during compression or decompression. (Default set to false) |
Level | Compression level from 0 to 9 (Default is 5) |
OutputString | Returns the result of compression or decompression when the output was set to string. |
WriteEndMark | If set to true then end marker is written in the stream. (Default false) |
Methods
Compress | Compresses the data that has been set by the input source, to the output destination. |
Decompress | Decompresses the data that has been set by the input source, to the output destination. |
shared PluginVersion | Returns the version number of the plugin. |
SetInputToStream | Sets the input to a BinaryStream. |
SetInputToString | Sets the input to a given string. |
SetOutputToStream | Sets the output to BinaryStream |
SetOutputToString | Sets the output to write to a string. The result will be written to the OutputString property. |
SetProgressHandler | Sets progress hander for the class. (Optional) |
Supported Platforms:
MacOS X Cocoa 32 bitMacOS X Cocoa 64 bitWindows 32 bitWindows 64 bitLinux 32 bitLinux 64 bitLinux ARMUnsupported Platforms:
MacOS X Carbon