Class SevenZipPPMdCompressionSettings


  • public final class SevenZipPPMdCompressionSettings
    extends SevenZipCompressionSettings

    Settings for PPMd compression method within 7z archive.

    • Constructor Detail

      • SevenZipPPMdCompressionSettings

        public SevenZipPPMdCompressionSettings​(int maxOrder,
                                               int suballocatorSize)

        Instantiates settings for PPMd compression method within 7z archive.

        
             try (SevenZipArchive archive = new SevenZipArchive(new SevenZipEntrySettings(new SevenZipPPMdCompressionSettings(4, 32)))) {
                 archive.createEntry("data.bin", "data.bin");
                 archive.save("zipFile.zip");
             }
         
        Parameters:
        maxOrder - Maximum order.

        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 - maxOrder is not between 2 and 32, or suballocatorSize is not between 1 and 1024.
      • SevenZipPPMdCompressionSettings

        public SevenZipPPMdCompressionSettings()

        Instantiates settings for PPMd compression method within 7z archive with default model order and sub-allocator size.

        
             try (SevenZipArchive archive = new SevenZipArchive(new SevenZipEntrySettings(new SevenZipPPMdCompressionSettings()))) {
                 archive.createEntry("data.bin", "data.bin");
                 archive.save("sevenZipFile.7z");
             }
         

        The default model order is 6 and sub-allocator size is 16MB.

    • Method Detail

      • getMaxOrder

        public final byte getMaxOrder()

        Gets the maximum order.

        Returns:
        the maximum order
      • getSuballocatorSize

        public final int getSuballocatorSize()

        Gets the sub-allocator size in MB.

        Returns:
        the sub-allocator size in MB