public interface Serializer<T>
Modifier and Type | Method and Description |
---|---|
T |
deserialize(byte[] bytes)
Returns a non-null instance of T from the byte array of length > 0.
|
byte[] |
serialize(T t)
Returns a byte array of length > 0 that is the serialization of the
given value.
|
byte[] serialize(T t) throws IOException
t
- value to be serialized into a byte array, should not be null.IOException
- on errorT deserialize(byte[] bytes) throws IOException, ClassNotFoundException
bytes
- byte array, should have length > 0IOException
- on errorClassNotFoundException
- if class T not foundCopyright © 2013–2020. All rights reserved.