SerializedType
- The type of object that can be serialized.public interface StreamSerializationHandler<SerializedType> extends FileSerializationHandler<SerializedType>
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
convertFromBytes(byte[] bytes)
Converts the first given object in the given byte array.
|
byte[] |
convertToBytes(SerializedType object)
Converts the given object to bytes.
|
java.lang.Object |
readObject(java.io.InputStream stream)
Reads an object from the given stream.
|
void |
writeObject(java.io.OutputStream stream,
SerializedType object)
Writes an object to a given output stream.
|
readFromFile, readFromFile, writeToFile, writeToFile
void writeObject(java.io.OutputStream stream, SerializedType object) throws java.io.IOException
stream
- The stream to write the object to.object
- The object to write.java.io.IOException
- If there is an i/o error.java.lang.Object readObject(java.io.InputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException
stream
- The stream to read an object from.java.io.IOException
- If there is an i/o error.java.lang.ClassNotFoundException
- If a class cannot be found.byte[] convertToBytes(SerializedType object) throws java.io.IOException
object
- The object to convert to bytes.java.io.IOException
- If there is an i/o error.java.lang.Object convertFromBytes(byte[] bytes) throws java.io.IOException, java.lang.ClassNotFoundException
bytes
- The bytes to convert the object from.java.io.IOException
- If there is an i/o error.java.lang.ClassNotFoundException
- If a class cannot be found.