Class XzArchiveSettings
Namespace: Aspose.Zip.Xz.Settings
Assembly: Aspose.Zip.dll (25.2.0)
The class contains set of setting particular xz archive.
public class XzArchiveSettings
Inheritance
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
XzArchiveSettings()
Initializes a new instance of the Aspose.Zip.Xz.Settings.XzArchiveSettings class using single LZMA2 compression.
public XzArchiveSettings()
Remarks
Default dictionary in LZMA2 filter size equals to 16 megabyte, default block size equals to 64 megabytes, default checksum type is CRC32.
XzArchiveSettings(XzFilterSettings[], long, XzCheckType)
Initializes a new instance of the Aspose.Zip.Xz.Settings.XzArchiveSettings class with custom parameters.
public XzArchiveSettings(XzFilterSettings[] filters, long blockSize, XzCheckType checkType)
Parameters
filters
XzFilterSettings[]
Filters (compressors) to be sequentially applied to create Aspose.Zip.Xz.XzArchive. It can be either single Aspose.Zip.Xz.Settings.XzLZMA2FilterSettings or pair of Aspose.Zip.Xz.Settings.XzBcjX86FilterSettings and Aspose.Zip.Xz.Settings.XzLZMA2FilterSettings
blockSize
long
Size xz archive block.
checkType
XzCheckType
Type of checksum calculation for uncompressed data.
Examples
using (FileStream xzFile = File.Open("archive.xz", FileMode.Create))
{
XzLZMA2FilterSettings filter = new XzLZMA2FilterSettings(5242880);
XzArchiveSettings settings = new XzArchiveSettings(new XzFilterSettings[] {filter}, 10485760, XzCheckType.Crc32);
using (var archive = new XzArchive(settings))
{
archive.SetSource("data.bin");
archive.Save(xzFile);
}
}
Exceptions
blockSize
is negative.
filters
is null
filters
has less than one or more than two filter, or last filter is not Aspose.Zip.Xz.Settings.XzLZMA2FilterSettings.
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
Remarks
Do not set this number more than CPU cores.
Exceptions
The number of threads is more than 100.
FastSpeed
Gets the instance of the Aspose.Zip.Xz.Settings.XzArchiveSettings class with dictionary size equals to 1 megabyte in LZMA2 filter, block size equals to 4 megabytes and CRC32 checksum.
public static XzArchiveSettings FastSpeed { get; }
Property Value
FastestSpeed
Gets the instance of the Aspose.Zip.Xz.Settings.XzArchiveSettings class with dictionary size equals to 65536 bytes in LZMA2 filter, block size equals to 1 megabyte and CRC32 checksum.
public static XzArchiveSettings FastestSpeed { get; }
Property Value
HighCompression
Gets the instance of the Aspose.Zip.Xz.Settings.XzArchiveSettings class with dictionary size equals to 32 megabytes in LZMA2 filter, block size equals to 128 megabytes and CRC32 checksum.
public static XzArchiveSettings HighCompression { get; }
Property Value
MaximumCompression
Gets the instance of the Aspose.Zip.Xz.Settings.XzArchiveSettings class with dictionary size equals to 64 megabytes in LZMA2 filter, block size equals to 256 megabytes and CRC32 checksum.
public static XzArchiveSettings MaximumCompression { get; }
Property Value
Normal
Gets the instance of the Aspose.Zip.Xz.Settings.XzArchiveSettings class with dictionary size equals to 16 megabytes in LZMA2 filter, block size equals to 64 megabytes and CRC32 checksum.
public static XzArchiveSettings Normal { get; }