Class ZlibCodecFactory
- java.lang.Object
-
- io.netty.handler.codec.compression.ZlibCodecFactory
-
public final class ZlibCodecFactory extends java.lang.Object
Creates a newZlibEncoder
and a newZlibDecoder
.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
DEFAULT_JDK_MEM_LEVEL
private static int
DEFAULT_JDK_WINDOW_SIZE
private static boolean
JZLIB_AVAILABLE
private static InternalLogger
logger
private static boolean
noJdkZlibDecoder
private static boolean
noJdkZlibEncoder
-
Constructor Summary
Constructors Modifier Constructor Description private
ZlibCodecFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
isSupportingWindowSizeAndMemLevel()
Returnstrue
if specify a custom window size and mem level is supported.static ZlibDecoder
newZlibDecoder()
Deprecated.UsenewZlibDecoder(int)
.static ZlibDecoder
newZlibDecoder(byte[] dictionary)
Deprecated.static ZlibDecoder
newZlibDecoder(byte[] dictionary, int maxAllocation)
Create a new decoder instance with the specified preset dictionary and maximum buffer allocation.static ZlibDecoder
newZlibDecoder(int maxAllocation)
Create a new decoder instance with specified maximum buffer allocation.static ZlibDecoder
newZlibDecoder(ZlibWrapper wrapper)
Deprecated.static ZlibDecoder
newZlibDecoder(ZlibWrapper wrapper, int maxAllocation)
Create a new decoder instance with the specified wrapper and maximum buffer allocation.static ZlibEncoder
newZlibEncoder(byte[] dictionary)
static ZlibEncoder
newZlibEncoder(int compressionLevel)
static ZlibEncoder
newZlibEncoder(int compressionLevel, byte[] dictionary)
static ZlibEncoder
newZlibEncoder(int compressionLevel, int windowBits, int memLevel, byte[] dictionary)
static ZlibEncoder
newZlibEncoder(ZlibWrapper wrapper)
static ZlibEncoder
newZlibEncoder(ZlibWrapper wrapper, int compressionLevel)
static ZlibEncoder
newZlibEncoder(ZlibWrapper wrapper, int compressionLevel, int windowBits, int memLevel)
-
-
-
Field Detail
-
logger
private static final InternalLogger logger
-
DEFAULT_JDK_WINDOW_SIZE
private static final int DEFAULT_JDK_WINDOW_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_JDK_MEM_LEVEL
private static final int DEFAULT_JDK_MEM_LEVEL
- See Also:
- Constant Field Values
-
noJdkZlibDecoder
private static final boolean noJdkZlibDecoder
-
noJdkZlibEncoder
private static final boolean noJdkZlibEncoder
-
JZLIB_AVAILABLE
private static final boolean JZLIB_AVAILABLE
-
-
Method Detail
-
isSupportingWindowSizeAndMemLevel
public static boolean isSupportingWindowSizeAndMemLevel()
Returnstrue
if specify a custom window size and mem level is supported.
-
newZlibEncoder
public static ZlibEncoder newZlibEncoder(int compressionLevel)
-
newZlibEncoder
public static ZlibEncoder newZlibEncoder(ZlibWrapper wrapper)
-
newZlibEncoder
public static ZlibEncoder newZlibEncoder(ZlibWrapper wrapper, int compressionLevel)
-
newZlibEncoder
public static ZlibEncoder newZlibEncoder(ZlibWrapper wrapper, int compressionLevel, int windowBits, int memLevel)
-
newZlibEncoder
public static ZlibEncoder newZlibEncoder(byte[] dictionary)
-
newZlibEncoder
public static ZlibEncoder newZlibEncoder(int compressionLevel, byte[] dictionary)
-
newZlibEncoder
public static ZlibEncoder newZlibEncoder(int compressionLevel, int windowBits, int memLevel, byte[] dictionary)
-
newZlibDecoder
@Deprecated public static ZlibDecoder newZlibDecoder()
Deprecated.UsenewZlibDecoder(int)
.Create a new decoder instance.
-
newZlibDecoder
public static ZlibDecoder newZlibDecoder(int maxAllocation)
Create a new decoder instance with specified maximum buffer allocation.- Parameters:
maxAllocation
- Maximum size of the decompression buffer. Must be >= 0. If zero, maximum size is not limited by decoder.
-
newZlibDecoder
@Deprecated public static ZlibDecoder newZlibDecoder(ZlibWrapper wrapper)
Deprecated.Create a new decoder instance with the specified wrapper.
-
newZlibDecoder
public static ZlibDecoder newZlibDecoder(ZlibWrapper wrapper, int maxAllocation)
Create a new decoder instance with the specified wrapper and maximum buffer allocation.- Parameters:
maxAllocation
- Maximum size of the decompression buffer. Must be >= 0. If zero, maximum size is not limited by decoder.
-
newZlibDecoder
@Deprecated public static ZlibDecoder newZlibDecoder(byte[] dictionary)
Deprecated.Create a new decoder instance with the specified preset dictionary. The wrapper is alwaysZlibWrapper.ZLIB
because it is the only format that supports the preset dictionary.
-
newZlibDecoder
public static ZlibDecoder newZlibDecoder(byte[] dictionary, int maxAllocation)
Create a new decoder instance with the specified preset dictionary and maximum buffer allocation. The wrapper is alwaysZlibWrapper.ZLIB
because it is the only format that supports the preset dictionary.- Parameters:
maxAllocation
- Maximum size of the decompression buffer. Must be >= 0. If zero, maximum size is not limited by decoder.
-
-