Class SevenZipLZMA2CompressionSettings

Class SevenZipLZMA2CompressionSettings

Namespace: Aspose.Zip.Saving
Assembly: Aspose.Zip.dll (25.2.0)

Settings needed for 7z compressor or decompressor to work.

public class SevenZipLZMA2CompressionSettings : SevenZipCompressionSettings

Inheritance

objectSevenZipCompressionSettingsSevenZipLZMA2CompressionSettings

Inherited Members

SevenZipCompressionSettings.Method, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Remarks

LZMA2 supports multiple runs of compressed LZMA data and uncompressed data.

See more: https://en.wikipedia.org/wiki/Lempel–Ziv–Markov_chain_algorithm

Constructors

SevenZipLZMA2CompressionSettings(int)

Instantiates settings for LZMA2 compression method within 7z archive.

public SevenZipLZMA2CompressionSettings(int dictionarySize = 16777216)

Parameters

dictionarySize int

Size of history buffer, must be between 4096 and 1073741824.

Remarks

The bigger the dictionary, the better the compression ratio usually is, but dictionaries bigger than the uncompressed data are waste of RAM.

Exceptions

ArgumentOutOfRangeException

dictionarySize is too big or too small.

SevenZipLZMA2CompressionSettings(int, int)

Instantiates settings for LZMA2 compression method within 7z archive.

public SevenZipLZMA2CompressionSettings(int dictionarySize, int fastBytes = 32)

Parameters

dictionarySize int

Size of history buffer, must be between 4096 and 1073741824.

fastBytes int

Controls number of fast bytes used by the LZMA2 compressors. A larger number of fast bytes can provide a better compression ratio at the expense of compression speed.

Remarks

The bigger the dictionary, the better the compression ratio usually is, but dictionaries bigger than the uncompressed data are waste of RAM.

Exceptions

ArgumentOutOfRangeException

dictionarySize is too big or too small, or fastBytes is too big or too small.

Properties

CompressionThreads

Gets or sets compression thread count. If the value greater than 1, multithreading compression will be used.

public int CompressionThreads { get; set; }

Property Value

int

Remarks

Do not set this number more than CPU cores.

Exceptions

ArgumentOutOfRangeException

The number of threads is more than 32.

DictionarySize

Dictionary (history buffer) size indicates how many bytes of the recently processed uncompressed data is kept in memory.

public int DictionarySize { get; }

Property Value

int

Remarks

The bigger the dictionary, the better the compression ratio usually is, but dictionaries bigger than the uncompressed data are waste of RAM.

FastBytes

Gets the controls number of fast bytes used by the LZMA2 compressor.

public int FastBytes { get; }

Property Value

int

Method

Gets compression or decompression method.

public override SevenZipCompressionMethod Method { get; }

Property Value

SevenZipCompressionMethod

 English