Class SevenZipPPMdCompressionSettings

Class SevenZipPPMdCompressionSettings

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

7z 压缩器或解压缩器所需的设置。

public sealed class SevenZipPPMdCompressionSettings : SevenZipCompressionSettings

继承

objectSevenZipCompressionSettingsSevenZipPPMdCompressionSettings

继承的成员

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

构造函数

SevenZipPPMdCompressionSettings(byte, int)

实例化 7z 压缩包内的 PPMd 压缩方法设置。

public SevenZipPPMdCompressionSettings(byte maxOrder, int suballocatorSize)

参数

maxOrder byte

最大顺序。

suballocatorSize int

子分配器可能消耗的内存大小(以 MB 为单位)。

示例

using (SevenZipArchive archive = new SevenZipArchive(new SevenZipEntrySettings(new SevenZipPPMdCompressionSettings(4, 32))))
{
    archive.CreateEntry("data.bin", "data.bin");                        
    archive.Save(sevenZipFile);
 }

备注

更大的模型顺序几乎肯定会导致更好的压缩,并且肯定会消耗更多的内存和 CPU。

PPMd 算法可能需要大量内存,特别是在处理大文件和/或使用较大模型顺序时。如果 PPMd 需要的内存超过您提供的内存,压缩效果会更差。

异常

ArgumentOutOfRangeException

maxOrder 不在 2 到 32 之间,或 suballocatorSize 不在 1 到 1024 之间。

SevenZipPPMdCompressionSettings()

实例化 7z 压缩包内的 PPMd 压缩方法设置,使用默认模型顺序和子分配器大小。

public SevenZipPPMdCompressionSettings()

示例

using (SevenZipArchive archive = new SevenZipArchive(new SevenZipEntrySettings(new SevenZipPPMdCompressionSettings())))
{
    archive.CreateEntry("data.bin", "data.bin");                        
    archive.Save(sevenZipFile);
 }

备注

默认模型顺序为 6,子分配器大小为 16MB。

属性

MaxOrder

获取最大顺序。

public byte MaxOrder { get; }

属性值

byte

Method

获取压缩或解压缩方法。

public override SevenZipCompressionMethod Method { get; }

属性值

SevenZipCompressionMethod

SuballocatorSize

获取子分配器大小(以 MB 为单位)。

public int SuballocatorSize { get; }

属性值

int

 中文