public class ZlibCodec extends Object implements CompressionCodec, DirectDecompressionCodec
CompressionCodec.DataKind, CompressionCodec.Options, CompressionCodec.SpeedModifier| Constructor and Description |
|---|
ZlibCodec() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Return the codec to the pool.
|
boolean |
compress(ByteBuffer in,
ByteBuffer out,
ByteBuffer overflow,
CompressionCodec.Options options)
Compress the in buffer to the out buffer.
|
void |
decompress(ByteBuffer in,
ByteBuffer out)
Decompress the in buffer to the out buffer.
|
void |
destroy()
Closes the codec, releasing the resources.
|
void |
directDecompress(ByteBuffer in,
ByteBuffer out) |
CompressionCodec.Options |
getDefaultOptions()
Get the default options for this codec.
|
CompressionKind |
getKind()
Get the compression kind.
|
boolean |
isAvailable() |
void |
reset()
Resets the codec, preparing it for reuse.
|
public CompressionCodec.Options getDefaultOptions()
CompressionCodecgetDefaultOptions in interface CompressionCodecpublic boolean compress(ByteBuffer in, ByteBuffer out, ByteBuffer overflow, CompressionCodec.Options options)
CompressionCodeccompress in interface CompressionCodecin - the bytes to compressout - the compressed bytesoverflow - put any additional bytes hereoptions - the options to control compressionpublic void decompress(ByteBuffer in, ByteBuffer out) throws IOException
CompressionCodecdecompress in interface CompressionCodecin - the bytes to decompressout - the decompressed bytesIOExceptionpublic boolean isAvailable()
isAvailable in interface DirectDecompressionCodecpublic void directDecompress(ByteBuffer in, ByteBuffer out) throws IOException
directDecompress in interface DirectDecompressionCodecIOExceptionpublic void reset()
CompressionCodecreset in interface CompressionCodecpublic void destroy()
CompressionCodecdestroy in interface CompressionCodecpublic CompressionKind getKind()
CompressionCodecgetKind in interface CompressionCodecpublic void close()
CompressionCodecclose in interface Closeableclose in interface AutoCloseableclose in interface CompressionCodecCopyright © 2013–2022 The Apache Software Foundation. All rights reserved.