| Constructor and Description |
|---|
CompositeCodec(Codec defaultCodec) |
CompositeCodec(Map<Class<?>,Codec> delegates,
Codec defaultCodec) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
decode(byte[] bytes,
Class<T> type)
Decode an object of a given type
|
<T> T |
decode(InputStream inputStream,
Class<T> type)
Decode an object of a given type
|
byte[] |
encode(Object object)
Encode an object to a byte array
|
void |
encode(Object object,
OutputStream outputStream)
Encode (encode) an object to an OutputStream
|
public CompositeCodec(Codec defaultCodec)
public void encode(Object object, OutputStream outputStream) throws IOException
Codecencode in interface Codecobject - the object to encodeoutputStream - the OutputStreamIOException - if the operation failspublic byte[] encode(Object object) throws IOException
Codecencode in interface Codecobject - the object to encodeIOException - if the operation failspublic <T> T decode(InputStream inputStream, Class<T> type) throws IOException
Codecdecode in interface CodecT - the object's typeinputStream - the input stream containing the encoded objecttype - the object's classIOException - if the operation failspublic <T> T decode(byte[] bytes,
Class<T> type)
throws IOException
Codecdecode in interface CodecT - the object's typebytes - the byte array containing the encoded objecttype - the object's classIOException - if the operation fails