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