Class PPMdCompressionSettings


  • public class PPMdCompressionSettings
    extends CompressionSettings

    Settings for PPMd compression within a ZIP archive.

    PPMd is a data compression algorithm developed by Dmitry Shkarin. This algorithm is based on predictive phrase matching on multiple order contexts.

    • Constructor Detail

      • PPMdCompressionSettings

        public PPMdCompressionSettings​(int modelOrder,
                                       int suballocatorSize)

        Initializes a new instance of the PPMdCompressionSettings class.

        
             try (Archive archive = new Archive(new ArchiveEntrySettings(new PPMdCompressionSettings(4, 10)))) {
                 archive.createEntry("data.bin", "data.bin");
                 archive.save("zipFile.zip");
             }
         
        Parameters:
        modelOrder - Order of the model.

        Bigger model orders almost surely results in better compression and surely more memory and CPU usage.

        suballocatorSize - Memory size in MB suballocator may consume.

        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.

        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - modelOrder is not between 2 and 16, or suballocatorSize is not between 1 and 256.
      • PPMdCompressionSettings

        public PPMdCompressionSettings()

        Initializes a new instance of the PPMdCompressionSettings class with default model order and sub-allocator size.

        
             try (Archive archive = new Archive(new ArchiveEntrySettings(new PPMdCompressionSettings()))) {
                 archive.createEntry("data.bin", "data.bin");
                 archive.save("zipFile.zip");
             }
         

        The default model order is 8, and the sub-allocator size is 50MB.

    • Method Detail

      • getModelOrder

        public final int getModelOrder()

        Gets the order of the model.

        Returns:
        the order of the model
      • getSuballocatorSize

        public final int getSuballocatorSize()

        Gets the sub-allocator size in MB.

        Returns:
        the sub-allocator size in MB