public final class SerializerJavaIO<T extends Serializable> extends Object implements Serializer<T>
| Constructor and Description |
|---|
SerializerJavaIO() |
| 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(Serializable t)
Returns a byte array of length > 0 that is the serialization of the
given value.
|
public byte[] serialize(Serializable t) throws IOException
Serializerserialize in interface Serializer<T extends Serializable>t - value to be serialized into a byte array, should not be null.IOException - on errorpublic T deserialize(byte[] bytes) throws ClassNotFoundException, IOException
Serializerdeserialize in interface Serializer<T extends Serializable>bytes - byte array, should have length > 0ClassNotFoundException - if class T not foundIOException - on errorCopyright © 2013–2020. All rights reserved.