Interface CompressionCodec
-
- All Known Implementing Classes:
CompressionCodecLZ4
,CompressionCodecNone
,CompressionCodecSnappy
,CompressionCodecZLib
,CompressionCodecZstd
public interface CompressionCodec
Generic compression codec interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description io.netty.buffer.ByteBuf
decode(io.netty.buffer.ByteBuf encoded, int uncompressedSize)
Decompress a buffer.io.netty.buffer.ByteBuf
encode(io.netty.buffer.ByteBuf raw)
Compress a buffer.
-
-
-
Method Detail
-
encode
io.netty.buffer.ByteBuf encode(io.netty.buffer.ByteBuf raw)
Compress a buffer.- Parameters:
raw
- a buffer with the uncompressed content. The reader/writer indexes will not be modified- Returns:
- a new buffer with the compressed content. The buffer needs to be released by the receiver
-
decode
io.netty.buffer.ByteBuf decode(io.netty.buffer.ByteBuf encoded, int uncompressedSize) throws java.io.IOException
Decompress a buffer.The buffer needs to have been compressed with the matching Encoder.
- Parameters:
encoded
- the compressed contentuncompressedSize
- the size of the original content- Returns:
- a ByteBuf with the compressed content. The buffer needs to be released by the receiver
- Throws:
java.io.IOException
- if the decompression fails
-
-