Class HttpContentCompressor

    • Field Detail

      • DEFAULT_JDK_WINDOW_SIZE

        private static final int DEFAULT_JDK_WINDOW_SIZE
        See Also:
        Constant Field Values
      • noJdkZlibEncoder

        private static final boolean noJdkZlibEncoder
      • compressionLevel

        private final int compressionLevel
      • windowBits

        private final int windowBits
      • memLevel

        private final int memLevel
    • Constructor Detail

      • HttpContentCompressor

        public HttpContentCompressor()
        Creates a new handler with the default compression level (6), default window size (15) and default memory level (8).
      • HttpContentCompressor

        public HttpContentCompressor​(int compressionLevel)
        Creates a new handler with the specified compression level, default window size (15) and default memory level (8).
        Parameters:
        compressionLevel - 1 yields the fastest compression and 9 yields the best compression. 0 means no compression. The default compression level is 6.
      • HttpContentCompressor

        public HttpContentCompressor​(int compressionLevel,
                                     int windowBits,
                                     int memLevel)
        Creates a new handler with the specified compression level, window size, and memory level.
        Parameters:
        compressionLevel - 1 yields the fastest compression and 9 yields the best compression. 0 means no compression. The default compression level is 6.
        windowBits - The base two logarithm of the size of the history buffer. The value should be in the range 9 to 15 inclusive. Larger values result in better compression at the expense of memory usage. The default value is 15.
        memLevel - How much memory should be allocated for the internal compression state. 1 uses minimum memory and 9 uses maximum memory. Larger values result in better and faster compression at the expense of memory usage. The default value is 8.
    • Method Detail

      • getTargetContentEncoding

        protected java.lang.String getTargetContentEncoding​(java.lang.String acceptEncoding)
                                                     throws java.lang.Exception
        Description copied from class: HttpContentEncoder
        Returns the expected content encoding of the encoded content.
        Specified by:
        getTargetContentEncoding in class HttpContentEncoder
        Parameters:
        acceptEncoding - the value of the "Accept-Encoding" header
        Returns:
        the expected content encoding of the new content
        Throws:
        java.lang.Exception
      • determineWrapper

        private static ZlibWrapper determineWrapper​(java.lang.String acceptEncoding)