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()
CompressionCodec
getDefaultOptions
in interface CompressionCodec
public boolean compress(ByteBuffer in, ByteBuffer out, ByteBuffer overflow, CompressionCodec.Options options)
CompressionCodec
compress
in interface CompressionCodec
in
- 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
CompressionCodec
decompress
in interface CompressionCodec
in
- the bytes to decompressout
- the decompressed bytesIOException
public boolean isAvailable()
isAvailable
in interface DirectDecompressionCodec
public void directDecompress(ByteBuffer in, ByteBuffer out) throws IOException
directDecompress
in interface DirectDecompressionCodec
IOException
public void reset()
CompressionCodec
reset
in interface CompressionCodec
public void destroy()
CompressionCodec
destroy
in interface CompressionCodec
public CompressionKind getKind()
CompressionCodec
getKind
in interface CompressionCodec
public void close()
CompressionCodec
close
in interface Closeable
close
in interface AutoCloseable
close
in interface CompressionCodec
Copyright © 2013–2022 The Apache Software Foundation. All rights reserved.