T - the object type@FunctionalInterface public interface Deserializer<T>
Serializer| Modifier and Type | Method and Description |
|---|---|
T |
deserialize(InputStream inputStream)
Read (assemble) an object of type T from the given InputStream.
|
default T |
deserializeFromByteArray(byte[] serialized)
Read (assemble) an object of type T from the given byte array.
|
T deserialize(InputStream inputStream) throws IOException
Note: Implementations should not close the given InputStream (or any decorators of that InputStream) but rather leave this up to the caller.
inputStream - the input streamIOException - in case of errors reading from the streamdefault T deserializeFromByteArray(byte[] serialized) throws IOException
serialized - the byte arrayIOException - in case of deserialization failure