Class PPMdCompressionSettings
Namespace: Aspose.Zip.Saving
Assembly: Aspose.Zip.dll (25.8.0)
Settings needed for compressor or decompressor to work.
public class PPMdCompressionSettings : CompressionSettingsInheritance
object ← CompressionSettings ← PPMdCompressionSettings
Inherited Members
CompressionSettings.Bzip2 , CompressionSettings.Deflate , CompressionSettings.EnhancedDeflate , CompressionSettings.Store , CompressionSettings.Lzma , CompressionSettings.Xz , CompressionSettings.PPMd , CompressionSettings.Zstd , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Remarks
PPMd is a data compression algorithm developed by Dmitry Shkarin. This algorithm is based on predictive phrase matching on multiple order contexts.
Constructors
PPMdCompressionSettings(int, int)
Initializes a new instance of the Aspose.Zip.Saving.PPMdCompressionSettings class.
public PPMdCompressionSettings(int modelOrder, int suballocatorSize)Parameters
modelOrder int
Order of the model.
suballocatorSize int
Memory size in MB suballocator may consume.
Examples
using (Archive archive = new Archive(new ArchiveEntrySettings(new PPMdCompressionSettings(4, 10))))
{
archive.CreateEntry("data.bin", "data.bin");
archive.Save(zipFile);
}Remarks
Bigger model orders almost surely results in better compression and surely more memory and CPU usage.
The PPMd algorithm might need a lot of memory, especially when used on large files and/or used with large model order. If ppmd needs more memory than you give it, the compression will be worse.
Exceptions
modelOrder is not between 2 and 16. - or - suballocatorSize is not between 1 and 256.
PPMdCompressionSettings()
Initializes a new instance of the Aspose.Zip.Saving.PPMdCompressionSettings class with default model order and sub-allocator size.
public PPMdCompressionSettings()Examples
using (Archive archive = new Archive(new ArchiveEntrySettings(new PPMdCompressionSettings())))
{
archive.CreateEntry("data.bin", "data.bin");
archive.Save(zipFile);
}Remarks
The default model order is 8, and the sub-allocator size is 50MB.
Properties
ModelOrder
Gets the order of the model.
public int ModelOrder { get; }Property Value
SuballocatorSize
Gets the sub-allocator size in MB.
public int SuballocatorSize { get; }