public interface Codec
Modifier and Type | Method and Description |
---|---|
<T> T |
decode(byte[] bytes,
java.lang.Class<T> type)
Decode an object of a given type
|
<T> T |
decode(java.io.InputStream inputStream,
java.lang.Class<T> type)
Decode an object of a given type
|
byte[] |
encode(java.lang.Object object)
Encode an object to a byte array
|
void |
encode(java.lang.Object object,
java.io.OutputStream outputStream)
Encode (encode) an object to an OutputStream
|
void encode(java.lang.Object object, java.io.OutputStream outputStream) throws java.io.IOException
object
- the object to encodeoutputStream
- the OutputStreamjava.io.IOException
- if the operation failsbyte[] encode(java.lang.Object object) throws java.io.IOException
object
- the object to encodejava.io.IOException
- if the operation fails<T> T decode(java.io.InputStream inputStream, java.lang.Class<T> type) throws java.io.IOException
T
- the object's typeinputStream
- the input stream containing the encoded objecttype
- the object's classjava.io.IOException
- if the operation fails<T> T decode(byte[] bytes, java.lang.Class<T> type) throws java.io.IOException
T
- the object's typebytes
- the byte array containing the encoded objecttype
- the object's classjava.io.IOException
- if the operation fails