Class SevenZipLZMA2CompressionSettings
- java.lang.Object
-
- com.aspose.zip.SevenZipCompressionSettings
-
- com.aspose.zip.SevenZipLZMA2CompressionSettings
-
public class SevenZipLZMA2CompressionSettings extends SevenZipCompressionSettings
Settings for LZMA2 compression method within 7z archive.
LZMA2 supports multiple runs of compressed LZMA data and uncompressed data.
See more: Lempel–Ziv–Markov_chain_algorithm
-
-
Constructor Summary
Constructors Constructor Description SevenZipLZMA2CompressionSettings()Instantiates settings for LZMA2 compression method within 7z archive.SevenZipLZMA2CompressionSettings(int dictionarySize)Instantiates settings for LZMA2 compression method within 7z archive.SevenZipLZMA2CompressionSettings(int dictionarySize, int fastBytes)Instantiates settings for LZMA2 compression method within 7z archive.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCompressionThreads()Gets compression thread count.intgetDictionarySize()Dictionary (history buffer) size indicates how many bytes of the recently processed uncompressed data are kept in memory.intgetFastBytes()Gets the control number of fast bytes used by the LZMA2 compressor.SevenZipCompressionMethodgetMethod()Gets compression or decompression method.voidsetCompressionThreads(int value)Sets compression thread count.
-
-
-
Constructor Detail
-
SevenZipLZMA2CompressionSettings
public SevenZipLZMA2CompressionSettings()
Instantiates settings for LZMA2 compression method within 7z archive.
-
SevenZipLZMA2CompressionSettings
public SevenZipLZMA2CompressionSettings(int dictionarySize)
Instantiates settings for LZMA2 compression method within 7z archive.
- Parameters:
dictionarySize- the size of history buffer, must be between 4096 and 1073741824.The bigger the dictionary, usually the better the compression ratio is - but dictionaries larger than the uncompressed data are a waste of RAM.
- Throws:
com.aspose.ms.System.ArgumentOutOfRangeException-dictionarySizeis too big or too small.
-
SevenZipLZMA2CompressionSettings
public SevenZipLZMA2CompressionSettings(int dictionarySize, int fastBytes)Instantiates settings for LZMA2 compression method within 7z archive.
- Parameters:
dictionarySize- the size of history buffer, must be between 4096 and 1073741824.The bigger the dictionary, usually the better the compression ratio is - but dictionaries larger than the uncompressed data are a waste of RAM.
fastBytes- controls the 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.- Throws:
com.aspose.ms.System.ArgumentOutOfRangeException-dictionarySizeis too big or too small, orfastBytesis too big or too small.
-
-
Method Detail
-
getMethod
public SevenZipCompressionMethod getMethod()
Gets compression or decompression method.
- Specified by:
getMethodin classSevenZipCompressionSettings- Returns:
- compression or decompression method.
-
getCompressionThreads
public final int getCompressionThreads()
Gets compression thread count. If the value is greater than 1, multithreading compression will be used.
- Returns:
- compression thread count
-
setCompressionThreads
public final void setCompressionThreads(int value)
Sets compression thread count. If the value is greater than 1, multithreading compression will be used.
- Parameters:
value- compression thread count.Do not set this number more than CPU cores.
- Throws:
com.aspose.ms.System.ArgumentOutOfRangeException- The number of threads is more than 32.
-
getDictionarySize
public final int getDictionarySize()
Dictionary (history buffer) size indicates how many bytes of the recently processed uncompressed data are kept in memory.
- Returns:
- dictionary (history buffer) size
-
getFastBytes
public final int getFastBytes()
Gets the control number of fast bytes used by the LZMA2 compressor.
- Returns:
- the control number of fast bytes used by the LZMA2 compressor
-
-