Class LZ4Codec
- java.lang.Object
- 
- jadex.platform.service.serialization.codecs.AbstractCodec
- 
- jadex.platform.service.serialization.codecs.LZ4Codec
 
 
- 
- All Implemented Interfaces:
- ICodec
 
 public class LZ4Codec extends AbstractCodec Converts byte[] -> byte[] in both directions.
- 
- 
Field SummaryFields Modifier and Type Field Description static intCODEC_IDThe gzip codec id.protected net.jpountz.lz4.LZ4Compressorcompressorprotected net.jpountz.lz4.LZ4FastDecompressordecompressorprotected static net.jpountz.lz4.LZ4FactoryLZ4FACTORYFactory for LZ4
 - 
Constructor SummaryConstructors Constructor Description LZ4Codec()Create a new codec.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]decode(byte[] bytes, int offset, int length)Decode bytes.byte[]decode(java.lang.Object bytes)Decode an object.static byte[]decodeBytes(net.jpountz.lz4.LZ4FastDecompressor decompressor, byte[] bytes, int offset, int length)Decode bytes.static byte[]decodeBytes(net.jpountz.lz4.LZ4FastDecompressor decompressor, java.io.ByteArrayInputStream bais)Decode bytes.byte[]encode(byte[] val)Encode an object.static byte[]encodeBytes(net.jpountz.lz4.LZ4Compressor compressor, byte[] val)Encode an object.intgetCodecId()Get the codec id.- 
Methods inherited from class jadex.platform.service.serialization.codecs.AbstractCodecdecode
 
- 
 
- 
- 
- 
Field Detail- 
LZ4FACTORYprotected static final net.jpountz.lz4.LZ4Factory LZ4FACTORY Factory for LZ4
 - 
CODEC_IDpublic static final int CODEC_ID The gzip codec id.- See Also:
- Constant Field Values
 
 - 
compressorprotected net.jpountz.lz4.LZ4Compressor compressor 
 - 
decompressorprotected net.jpountz.lz4.LZ4FastDecompressor decompressor 
 
- 
 - 
Method Detail- 
getCodecIdpublic int getCodecId() Get the codec id.- Returns:
- The codec id.
 
 - 
encodepublic byte[] encode(byte[] val) Encode an object.- Parameters:
- obj- The object.
- Returns:
- The encoded object.
- Throws:
- java.io.IOException
 
 - 
decodepublic byte[] decode(java.lang.Object bytes) Decode an object.- Returns:
- The decoded object.
- Throws:
- java.io.IOException
 
 - 
decodepublic byte[] decode(byte[] bytes, int offset, int length)Decode bytes.- Parameters:
- bytes- The value bytes as byte array or input stream.
- Returns:
- The decoded bytes.
- Throws:
- java.io.IOException
 
 - 
encodeBytespublic static byte[] encodeBytes(net.jpountz.lz4.LZ4Compressor compressor, byte[] val)Encode an object.- Parameters:
- obj- The object.
- Throws:
- java.io.IOException
 
 - 
decodeBytespublic static byte[] decodeBytes(net.jpountz.lz4.LZ4FastDecompressor decompressor, byte[] bytes, int offset, int length)Decode bytes.- Returns:
- The decoded bytes.
- Throws:
- java.io.IOException
 
 - 
decodeBytespublic static byte[] decodeBytes(net.jpountz.lz4.LZ4FastDecompressor decompressor, java.io.ByteArrayInputStream bais)Decode bytes.- Returns:
- The decoded bytes.
- Throws:
- java.io.IOException
 
 
- 
 
-