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.

Object
   LZMA2

class LZMA2

Properties

AllowYieldIf set to true then the plugin will yield to Xojo threads during compression or decompression. (Default set to false)
LevelCompression level from 0 to 9 (Default is 5)
OutputStringReturns the result of compression or decompression when the output was set to string.
WriteEndMarkIf set to true then end marker is written in the stream. (Default false)

Methods

CompressCompresses the data that has been set by the input source, to the output destination.
DecompressDecompresses the data that has been set by the input source, to the output destination.
shared PluginVersionReturns the version number of the plugin.
SetInputToStreamSets the input to a BinaryStream.
SetInputToStringSets the input to a given string.
SetOutputToStreamSets the output to BinaryStream
SetOutputToStringSets the output to write to a string. The result will be written to the OutputString property.
SetProgressHandlerSets progress hander for the class. (Optional)

Supported Platforms:

  • MacOS X Cocoa 32 bit
  • MacOS X Cocoa 64 bit
  • Windows 32 bit
  • Windows 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM

    Unsupported Platforms:

  • MacOS X Carbon