Class XzArchiveSettings

Class XzArchiveSettings

名称: Aspose.Zip.Xz.Settings 收藏: Aspose.Zip.dll (25.5.0)

该类包含一个设置特定 xz 档案的集合。

public class XzArchiveSettings

Inheritance

object XzArchiveSettings

继承人

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

Constructors

XzArchiveSettings()

启动 Aspose.Zip.Xz.Settings.XzArchiveSettings 类的新例子,使用单个 LZMA2 压缩。

public XzArchiveSettings()

Remarks

LZMA2 过滤器的默认字典大小相当于 16 兆比特,默定的区块大小的比例为 64 MB,一个默定支票类型是 CRC32.

XzArchiveSettings(XzFilterSettings( ), 长, XzCheckType)

以定制参数启动 Aspose.Zip.Xz.Settings.XzArchiveSettings 类的新例子。

public XzArchiveSettings(XzFilterSettings[] filters, long blockSize, XzCheckType checkType)

Parameters

filters XzFilterSettings ( )

过滤器(压缩器)可以连续应用于创建 Aspose.Zip.Xz.XzArchive. 它可以是单一的 Aspose.Zip.Xz.Settings.XzLZMA2FilterSettings或一对 Aspose.Zip.Xz.Settings.XzBcjX86FilterSettings 和 Aspose.Zip.Xz.Settings.XzLZMA2FilterSettings

blockSize long

xz 存档区块。

checkType XzCheckType

对未压缩数据的支票计算类型。

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

ArgumentOutOfRangeException

blockSize’ is negative.

ArgumentNullException

filters’ is null

ArgumentException

filters’ has less than one or more than two filters, or last filter is not Aspose.Zip.Xz.Settings.XzLZMA2FilterSettings.

Properties

CompressionThreads

接收或设置压缩条数,如果值超过1,将使用多条压。

public int CompressionThreads { get; set; }

财产价值

int

Remarks

不要设置这个数字超过CPU核心。

Exceptions

ArgumentOutOfRangeException

线条的数量超过100。

FastSpeed

获取 Aspose.Zip.Xz.Settings.XzArchiveSettings 类的例子字典大小相当于 LZMA2 过滤器中的 1 兆巴特,区块大小相当于 4 兆巴特和 CRC32 检查室。

public static XzArchiveSettings FastSpeed { get; }

财产价值

XzArchiveSettings

FastestSpeed

获取 Aspose.Zip.Xz.Settings.XzArchiveSettings 类的例子在 LZMA2 过滤器中,字典大小相当于 65536 位元,区块大小相当于 1 位元和 CRC32 支票。

public static XzArchiveSettings FastestSpeed { get; }

财产价值

XzArchiveSettings

HighCompression

获取 Aspose.Zip.Xz.Settings.XzArchiveSettings 类的例子在 LZMA2 过滤器中,字典大小相当于 32 兆比特,区块大小相当于 128 兆比特和 CRC32 检查室。

public static XzArchiveSettings HighCompression { get; }

财产价值

XzArchiveSettings

MaximumCompression

获取 Aspose.Zip.Xz.Settings.XzArchiveSettings 类的例子在 LZMA2 过滤器中,字典大小相当于 64 兆比特,区块大小相当于 256 兆比特和 CRC32 检查室。

public static XzArchiveSettings MaximumCompression { get; }

财产价值

XzArchiveSettings

Normal

获取 Aspose.Zip.Xz.Settings.XzArchiveSettings 类的例子在 LZMA2 过滤器中,字典大小相当于 16 兆比特,区块大小相当于 64 兆比特和 CRC32 检查室。

public static XzArchiveSettings Normal { get; }

财产价值

XzArchiveSettings

 中文