Class StandardCompressionOptions

java.lang.Object
io.netty.handler.codec.compression.StandardCompressionOptions

public final class StandardCompressionOptions extends Object
Standard Compression Options for BrotliOptions, GzipOptions and DeflateOptions
  • Method Details

    • brotli

      public static BrotliOptions brotli()
      Default implementation of BrotliOptions with Encoder.Parameters.setQuality(int) set to 4 and Encoder.Parameters.setMode(Encoder.Mode) set to Encoder.Mode.TEXT
    • brotli

      @Deprecated public static BrotliOptions brotli(com.aayushatharva.brotli4j.encoder.Encoder.Parameters parameters)
      Create a new BrotliOptions
      Parameters:
      parameters - Encoder.Parameters Instance
      Throws:
      NullPointerException - If Encoder.Parameters is null
    • brotli

      public static BrotliOptions brotli(int quality, int window, BrotliMode mode)
      Create a new BrotliOptions
      Parameters:
      quality - Specifies the compression level.
      window - Specifies the size of the sliding window when compressing.
      mode - optimizes the compression algorithm based on the type of input data.
      Throws:
      NullPointerException - If BrotliMode is null
    • zstd

      public static ZstdOptions zstd()
      Default implementation of ZstdOptions with{compressionLevel(int)} set to ZstdConstants.DEFAULT_COMPRESSION_LEVEL,ZstdConstants.DEFAULT_BLOCK_SIZE, ZstdConstants.DEFAULT_MAX_ENCODE_SIZE
    • zstd

      public static ZstdOptions zstd(int compressionLevel, int blockSize, int maxEncodeSize)
      Create a new ZstdOptions
      Parameters:
      compressionLevel - specifies the level of the compression
      blockSize - is used to calculate the compressionLevel
      maxEncodeSize - specifies the size of the largest compressed object
    • snappy

      public static SnappyOptions snappy()
      Create a new SnappyOptions
    • gzip

      public static GzipOptions gzip()
      Default implementation of GzipOptions with compressionLevel() set to 6, windowBits() set to 15 and memLevel() set to 8.
    • gzip

      public static GzipOptions gzip(int compressionLevel, int windowBits, int memLevel)
      Create a new GzipOptions Instance
      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
    • deflate

      public static DeflateOptions deflate()
      Default implementation of DeflateOptions with compressionLevel set to 6, windowBits set to 15 and memLevel set to 8.
    • deflate

      public static DeflateOptions deflate(int compressionLevel, int windowBits, int memLevel)
      Create a new DeflateOptions Instance
      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