Class JdkZlibEncoder

    • Constructor Detail

      • JdkZlibEncoder

        public JdkZlibEncoder()
        Creates a new zlib encoder with the default compression level (6) and the default wrapper (ZlibWrapper.ZLIB).
        Throws:
        CompressionException - if failed to initialize zlib
      • JdkZlibEncoder

        public JdkZlibEncoder​(int compressionLevel)
        Creates a new zlib encoder with the specified compressionLevel and the default wrapper (ZlibWrapper.ZLIB).
        Parameters:
        compressionLevel - 1 yields the fastest compression and 9 yields the best compression. 0 means no compression. The default compression level is 6.
        Throws:
        CompressionException - if failed to initialize zlib
      • JdkZlibEncoder

        public JdkZlibEncoder​(ZlibWrapper wrapper)
        Creates a new zlib encoder with the default compression level (6) and the specified wrapper.
        Throws:
        CompressionException - if failed to initialize zlib
      • JdkZlibEncoder

        public JdkZlibEncoder​(ZlibWrapper wrapper,
                              int compressionLevel)
        Creates a new zlib encoder with the specified compressionLevel and the specified wrapper.
        Parameters:
        compressionLevel - 1 yields the fastest compression and 9 yields the best compression. 0 means no compression. The default compression level is 6.
        Throws:
        CompressionException - if failed to initialize zlib
      • JdkZlibEncoder

        public JdkZlibEncoder​(byte[] dictionary)
        Creates a new zlib encoder with the default compression level (6) and the specified preset dictionary. The wrapper is always ZlibWrapper.ZLIB because it is the only format that supports the preset dictionary.
        Parameters:
        dictionary - the preset dictionary
        Throws:
        CompressionException - if failed to initialize zlib
      • JdkZlibEncoder

        public JdkZlibEncoder​(int compressionLevel,
                              byte[] dictionary)
        Creates a new zlib encoder with the specified compressionLevel and the specified preset dictionary. The wrapper is always ZlibWrapper.ZLIB because it is the only format that supports the preset dictionary.
        Parameters:
        compressionLevel - 1 yields the fastest compression and 9 yields the best compression. 0 means no compression. The default compression level is 6.
        dictionary - the preset dictionary
        Throws:
        CompressionException - if failed to initialize zlib