Class SevenZipLZMACompressionSettings
Namespace: Aspose.Zip.Saving
Assembly: Aspose.Zip.dll (25.12.0)
Settings for LZMA compression method within 7z archive.
public class SevenZipLZMACompressionSettings : SevenZipCompressionSettingsInheritance
object ← SevenZipCompressionSettings ← SevenZipLZMACompressionSettings
Inherited Members
SevenZipCompressionSettings.Method , 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: Lempel–Ziv–Markov chain algorithm
Constructors
SevenZipLZMACompressionSettings()
Initializes a new instance of the Aspose.Zip.Saving.SevenZipLZMACompressionSettings class with default parameters.
public SevenZipLZMACompressionSettings()Examples
using (var archive = new SevenZipArchive(new SevenZipEntrySettings(new SevenZipLZMACompressionSettings())))
{
archive.CreateEntry("data.bin", "data.bin");
archive.Save("result.7z");
}SevenZipLZMACompressionSettings(int, int, int)
Initializes a new instance of the Aspose.Zip.Saving.SevenZipLZMACompressionSettings class with specified dictionary size, number of fast bytes and number of literal context bits.
public SevenZipLZMACompressionSettings(int dictionarySize, int numberOfFastBytes, int literalContextBits)Parameters
dictionarySize int
Dictionary (history buffer) size in bytes. Must be between 4096 and 1073741824, or equal to zero for automatic detection based on entry size.
numberOfFastBytes int
The number of bytes used for fast match searching in the LZMA algorithm. Can be in the range from 5 to 273.
literalContextBits int
Sets the number of literal context bits (high bits of previous literal). It can be in range from 0 to 8.
SevenZipLZMACompressionSettings(int)
Initializes a new instance of the Aspose.Zip.Saving.SevenZipLZMACompressionSettings class with specified dictionary size, number of fast bytes equal to 32, number of literal context bits equal to 3.
public SevenZipLZMACompressionSettings(int dictionarySize)Parameters
dictionarySize int
Dictionary (history buffer) size in bytes. Must be between 4096 and 1073741824, or equal to zero for automatic detection based on entry size.
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. Must be between 4096 and 1073741824, or equal to zero for automatic detection based on entry size.
public int DictionarySize { get; set; }Property Value
Remarks
The bigger the dictionary, usually the better the compression ratio is - but dictionaries larger than the uncompressed data are a waste of RAM.
LiteralContextBits
Gets the number of literal context bits.
public int LiteralContextBits { get; }Property Value
Remarks
Literal Context Bits define how many of the most significant bits of the previous uncompressed byte are used to predict the bits of the next literal byte. Must be from 0 to 8.
Method
Gets compression or decompression method.
public override SevenZipCompressionMethod Method { get; }Property Value
NumberOfFastBytes
Gets the number of bytes used for fast match searching in the LZMA algorithm.
public int NumberOfFastBytes { get; }Property Value
Remarks
A higher value allows the compressor to search longer matches, which can improve the compression ratio slightly but slows down compression.