Class LzmaArchiveSettings
Namespace: Aspose.Zip.LZMA
Assembly: Aspose.Zip.dll (25.2.0)
Settings for lzma archive.
public class LzmaArchiveSettings
Inheritance
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
The Lempel–Ziv–Markov chain algorithm (LZMA) is an algorithm used to perform lossless data compression. This algorithm uses a dictionary compression scheme somewhat similar to the LZ77 algorithm and features a high compression ratio and a variable compression-dictionary size.
See more: https://en.wikipedia.org/wiki/Lempel–Ziv–Markov_chain_algorithm
Constructors
LzmaArchiveSettings()
Initializes a new instance of the Aspose.Zip.LZMA.LzmaArchiveSettings class with default dictionary size, equals to 16 megabytes.
public LzmaArchiveSettings()
Examples
using (LzmaArchive archive = new LzmaArchive(new LzmaArchiveSettings() { DictionarySize = 1048576 } )
{
archive.SetSource("data.bin);
archive.Save(lzmaFile);
}
Properties
DictionarySize
Dictionary (history buffer) size indicates how many bytes of the recently processed uncompressed data is kept in memory. If not set, will be chosen accordingly to entry size.
public int DictionarySize { get; set; }
Property Value
Remarks
The bigger the dictionary, the better the compression ratio usually is, but dictionaries bigger than the uncompressed data are waste of RAM.
CompressionProgressed
Raises when a portion of raw stream compressed.
public event EventHandler<progresseventargs> CompressionProgressed
Event Type
EventHandler<ProgressEventArgs>
Examples
lzmaArchiveSettings.CompressionProgressed += (s, e) => { int percent = (int)((100 * (long)e.ProceededBytes) / entrySourceStream.Length); };