T - the type of (de)serialized objects@ParametersAreNonnullByDefault public abstract class AbstractBinarySerializer<T> extends Object implements BinarySerializer<T>
BinarySerializer for objects of type T.| Constructor and Description |
|---|
AbstractBinarySerializer() |
| Modifier and Type | Method and Description |
|---|---|
T |
deserialize(byte[] data)
Reads and assembles an object of type
T from the given data. |
T |
deserialize(InputStream is)
Reads and assembles an object of type
T from the given is. |
byte[] |
serialize(T t)
Write an object of type
T into its basic representation. |
void |
serialize(T t,
OutputStream os)
Write an object of type
T to the given os. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeserialize, serializeconvert, revert@Nonnull public byte[] serialize(T t) throws IOException
SerializerT into its basic representation.serialize in interface Serializer<T,byte[]>t - the object to serializeIOException - if an I/O error occurs during the serialization@Nonnull public T deserialize(byte[] data) throws IOException
SerializerT from the given data.deserialize in interface Serializer<T,byte[]>data - the basic representation of the objectIOException - if an I/O error occurs during the deserializationpublic void serialize(T t, @WillNotClose OutputStream os) throws IOException
BinarySerializerT to the given os.
If the os also implements DataOutput, prefer using BinarySerializer.serialize(Object, DataOutput). This
method will create a adapter on os before calling it.
serialize in interface BinarySerializer<T>t - the object to serializeos - the output streamIOException - if an I/O error occurs during the serialization@Nonnull public T deserialize(@WillNotClose InputStream is) throws IOException
BinarySerializerT from the given is.
If the is also implements DataInput, prefer using BinarySerializer.deserialize(DataInput). This method
will create a adapter on is before calling it.
deserialize in interface BinarySerializer<T>is - the input streamIOException - if an I/O error occurs during the deserializationCopyright © 2017–2019 Atlanmod. All rights reserved.