public interface Codec
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
decode(byte[] value)
Decode a byte[] form of an object back into the corresponding object.
|
java.lang.Object |
decode(byte[] value,
java.lang.ClassLoader cl)
Decode a byte[] form of an object back into the corresponding object using the class loader passed.
|
byte[] |
encode(java.lang.Object value)
Encode an object to a byte[] form.
|
byte[] encode(java.lang.Object value) throws java.io.IOException
value
- the value to convert. A null value will be encoded.java.io.IOException
- if the object cannot be converted.java.lang.Object decode(byte[] value) throws java.io.IOException
value
- the value to convert. This value will never be null
.java.io.IOException
- if the byte[] value cannot be converted into an object.java.lang.Object decode(byte[] value, java.lang.ClassLoader cl) throws java.io.IOException
value
- the value to convert. This value will never be null
.cl
- the class loader to use when decodingjava.io.IOException
- if the byte[] value cannot be converted into an object.