Package com.atlassian.bamboo.serialisers
Interface ObjectSerialiser
- All Known Implementing Classes:
JavaObjectSerialiser
,KryoObjectSerialiser
,XStreamObjectSerialiser
public interface ObjectSerialiser
Interface for classes capable of Serialising/deserialising objects.
-
Method Summary
Modifier and TypeMethodDescriptionint
getTag()
Returns an unique identifier for this object serialiserreadObject
(InputStream inputStream) Retreieves an object from a stream.@NotNull OutputStream
writeObject
(Object object, OutputStream outputStream) Writes an object to the supplied stream.
-
Method Details
-
writeObject
@NotNull @NotNull OutputStream writeObject(Object object, OutputStream outputStream) throws IOException Writes an object to the supplied stream. Returns a stream that should be used for subsequent calls, or closed if no longer needed. It may be the same stream or a wrapped stream.- Throws:
IOException
-
readObject
Pair<InputStream,Object> readObject(InputStream inputStream) throws IOException, ClassNotFoundException Retreieves an object from a stream. Returns a stream and a desrialised object. The stream should be used for subsequent calls, or closed if no longer needed. It may be the same stream or a wrapped stream.- Parameters:
inputStream
-- Throws:
IOException
ClassNotFoundException
-
getTag
int getTag()Returns an unique identifier for this object serialiser
-