T - the type of (de)serialized objects@ParametersAreNonnullByDefault public interface BinarySerializer<T> extends Serializer<T,byte[]>, Serializable
Object to byte[] encoding and decoding.| Modifier and Type | Method and Description |
|---|---|
T |
deserialize(DataInput in)
Reads and assembles an object of type
T from the given in. |
T |
deserialize(InputStream is)
Reads and assembles an object of type
T from the given is. |
void |
serialize(T t,
DataOutput out)
Write an object of type
T to the given out. |
void |
serialize(T t,
OutputStream os)
Write an object of type
T to the given os. |
convert, deserialize, revert, serializevoid serialize(T t, @WillNotClose OutputStream os) throws IOException
T to the given os.
If the os also implements DataOutput, prefer using serialize(Object, DataOutput). This
method will create a adapter on os before calling it.
t - the object to serializeos - the output streamIOException - if an I/O error occurs during the serializationvoid serialize(T t, @WillNotClose DataOutput out) throws IOException
T to the given out.t - the object to serializeout - the output streamIOException - if an I/O error occurs during the serialization@Nonnull T deserialize(@WillNotClose InputStream is) throws IOException
T from the given is.
If the is also implements DataInput, prefer using deserialize(DataInput). This method
will create a adapter on is before calling it.
is - the input streamIOException - if an I/O error occurs during the deserialization@Nonnull T deserialize(@WillNotClose DataInput in) throws IOException
T from the given in.in - the input streamIOException - if an I/O error occurs during the deserializationCopyright © 2017–2019 Atlanmod. All rights reserved.