Class CompressionCodecLZ4
- java.lang.Object
-
- org.apache.pulsar.common.compression.CompressionCodecLZ4
-
- All Implemented Interfaces:
CompressionCodec
public class CompressionCodecLZ4 extends java.lang.Object implements CompressionCodec
LZ4 Compression.
-
-
Constructor Summary
Constructors Constructor Description CompressionCodecLZ4()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.buffer.ByteBufdecode(io.netty.buffer.ByteBuf encoded, int uncompressedLength)Decompress a buffer.io.netty.buffer.ByteBufencode(io.netty.buffer.ByteBuf source)Compress a buffer.
-
-
-
Method Detail
-
encode
public io.netty.buffer.ByteBuf encode(io.netty.buffer.ByteBuf source)
Description copied from interface:CompressionCodecCompress a buffer.- Specified by:
encodein interfaceCompressionCodec- Parameters:
source- 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
public io.netty.buffer.ByteBuf decode(io.netty.buffer.ByteBuf encoded, int uncompressedLength) throws java.io.IOExceptionDescription copied from interface:CompressionCodecDecompress a buffer.The buffer needs to have been compressed with the matching Encoder.
- Specified by:
decodein interfaceCompressionCodec- Parameters:
encoded- the compressed contentuncompressedLength- 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
-
-