Class GZIPCodec
- java.lang.Object
-
- jadex.platform.service.serialization.codecs.AbstractCodec
-
- jadex.platform.service.serialization.codecs.GZIPCodec
-
- All Implemented Interfaces:
ICodec
public class GZIPCodec extends AbstractCodec
Converts byte[] -> byte[] in both directions.
-
-
Field Summary
Fields Modifier and Type Field Description static int
CODEC_ID
The gzip codec id.
-
Constructor Summary
Constructors Constructor Description GZIPCodec()
Create a new codec.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
decode(byte[] bytes, int offset, int length)
Decode bytes.static byte[]
decodeBytes(byte[] bytes, int offset, int length)
Decode bytes.static byte[]
decodeBytes(java.io.ByteArrayInputStream bais)
Decode bytes.byte[]
encode(byte[] val)
Encode an object.static byte[]
encodeBytes(byte[] val)
Encode an object.int
getCodecId()
Get the codec id.-
Methods inherited from class jadex.platform.service.serialization.codecs.AbstractCodec
decode
-
-
-
-
Field Detail
-
CODEC_ID
public static final int CODEC_ID
The gzip codec id.- See Also:
- Constant Field Values
-
-
Method Detail
-
getCodecId
public int getCodecId()
Get the codec id.- Returns:
- The codec id.
-
encode
public byte[] encode(byte[] val)
Encode an object.- Parameters:
obj
- The object.- Returns:
- The encoded object.
- Throws:
java.io.IOException
-
decode
public 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
-
encodeBytes
public static byte[] encodeBytes(byte[] val)
Encode an object.- Parameters:
obj
- The object.- Throws:
java.io.IOException
-
decodeBytes
public static byte[] decodeBytes(byte[] bytes, int offset, int length)
Decode bytes.- Returns:
- The decoded bytes.
- Throws:
java.io.IOException
-
decodeBytes
public static byte[] decodeBytes(java.io.ByteArrayInputStream bais)
Decode bytes.- Returns:
- The decoded bytes.
- Throws:
java.io.IOException
-
-