Interface CompressionCodec
- All Known Implementing Classes:
CompressionCodecLZ4,CompressionCodecNone,CompressionCodecSnappy,CompressionCodecZLib,CompressionCodecZstd
public interface CompressionCodec
Generic compression codec interface.
-
Method Summary
-
Method Details
-
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 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:
IOException- if the decompression fails
-