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