接口 CompressionCodec
- 所有已知实现类:
CompressionCodecLZ4,CompressionCodecNone,CompressionCodecSnappy,CompressionCodecZLib,CompressionCodecZstd
public interface CompressionCodec
Generic compression codec interface.
-
方法概要
-
方法详细资料
-
encode
io.netty.buffer.ByteBuf encode(io.netty.buffer.ByteBuf raw) Compress a buffer.- 参数:
raw- a buffer with the uncompressed content. The reader/writer indexes will not be modified- 返回:
- 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.
- 参数:
encoded- the compressed contentuncompressedSize- the size of the original content- 返回:
- a ByteBuf with the compressed content. The buffer needs to be released by the receiver
- 抛出:
IOException- if the decompression fails
-