- java.lang.Object
-
- io.netty5.handler.codec.compression.StandardCompressionOptions
-
public final class StandardCompressionOptions extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BrotliOptions
brotli()
Default implementation ofBrotliOptions
withEncoder.Parameters.setQuality(int)
set to 4 andEncoder.Parameters.setMode(Encoder.Mode)
set toEncoder.Mode.TEXT
static BrotliOptions
brotli(com.aayushatharva.brotli4j.encoder.Encoder.Parameters parameters)
Create a newBrotliOptions
static DeflateOptions
deflate()
Default implementation ofDeflateOptions
withcompressionLevel
set to 6,windowBits
set to 15 andmemLevel
set to 8.static DeflateOptions
deflate(int compressionLevel, int windowBits, int memLevel)
Create a newDeflateOptions
Instancestatic GzipOptions
gzip()
Default implementation ofGzipOptions
withcompressionLevel()
set to 6,windowBits()
set to 15 andmemLevel()
set to 8.static GzipOptions
gzip(int compressionLevel, int windowBits, int memLevel)
Create a newGzipOptions
Instancestatic ZstdOptions
zstd()
Default implementation ofZstdOptions
with{compressionLevel(int)} set toZstdConstants.DEFAULT_COMPRESSION_LEVEL
,ZstdConstants.DEFAULT_BLOCK_SIZE
,ZstdConstants.MAX_BLOCK_SIZE
static ZstdOptions
zstd(int compressionLevel, int blockSize, int maxEncodeSize)
Create a newZstdOptions
-
-
-
Method Detail
-
brotli
public static BrotliOptions brotli()
Default implementation ofBrotliOptions
withEncoder.Parameters.setQuality(int)
set to 4 andEncoder.Parameters.setMode(Encoder.Mode)
set toEncoder.Mode.TEXT
-
brotli
public static BrotliOptions brotli(com.aayushatharva.brotli4j.encoder.Encoder.Parameters parameters)
Create a newBrotliOptions
- Parameters:
parameters
-Encoder.Parameters
Instance- Throws:
NullPointerException
- IfEncoder.Parameters
isnull
-
zstd
public static ZstdOptions zstd()
Default implementation ofZstdOptions
with{compressionLevel(int)} set toZstdConstants.DEFAULT_COMPRESSION_LEVEL
,ZstdConstants.DEFAULT_BLOCK_SIZE
,ZstdConstants.MAX_BLOCK_SIZE
-
zstd
public static ZstdOptions zstd(int compressionLevel, int blockSize, int maxEncodeSize)
Create a newZstdOptions
- Parameters:
blockSize
- is used to calculate the compressionLevelmaxEncodeSize
- specifies the size of the largest compressed objectcompressionLevel
- specifies the level of the compression
-
gzip
public static GzipOptions gzip()
Default implementation ofGzipOptions
withcompressionLevel()
set to 6,windowBits()
set to 15 andmemLevel()
set to 8.
-
gzip
public static GzipOptions gzip(int compressionLevel, int windowBits, int memLevel)
Create a newGzipOptions
Instance- Parameters:
compressionLevel
-1
yields the fastest compression and9
yields the best compression.0
means no compression. The default compression level is6
.windowBits
- The base two logarithm of the size of the history buffer. The value should be in the range9
to15
inclusive. Larger values result in better compression at the expense of memory usage. The default value is15
.memLevel
- How much memory should be allocated for the internal compression state.1
uses minimum memory and9
uses maximum memory. Larger values result in better and faster compression at the expense of memory usage. The default value is8
-
deflate
public static DeflateOptions deflate()
Default implementation ofDeflateOptions
withcompressionLevel
set to 6,windowBits
set to 15 andmemLevel
set to 8.
-
deflate
public static DeflateOptions deflate(int compressionLevel, int windowBits, int memLevel)
Create a newDeflateOptions
Instance- Parameters:
compressionLevel
-1
yields the fastest compression and9
yields the best compression.0
means no compression. The default compression level is6
.windowBits
- The base two logarithm of the size of the history buffer. The value should be in the range9
to15
inclusive. Larger values result in better compression at the expense of memory usage. The default value is15
.memLevel
- How much memory should be allocated for the internal compression state.1
uses minimum memory and9
uses maximum memory. Larger values result in better and faster compression at the expense of memory usage. The default value is8
-
-