Interface semper.util.serial.Streamable
All Packages Class Hierarchy This Package Previous Next Index
Interface semper.util.serial.Streamable
- public interface Streamable
- extends Object
This interface defines the rules objects have to
implement to allow their conversion to bytestreams and vice versa
for communication, archival and cryptographic operations.
Externalizing an object is to record the object state in a stream
of data. Objects which implement this interface can be
externalized to a stream (in memory, on a disk file, across the
network, etc.) and subsequently be internalized into a new object
in the same or a different process.
Object implementors must
implement the Streamable interface if they wish an object
to be externalizable.
- Version:
- 2.0, 05/28/96
- Author:
- Günter Karjoth, Michael Steiner
- See Also:
- TargetStream, SourceStream
-
myStreamSize()
- Determines the size of the stream that would hold the externalized
form of the object.
-
readObject(StreamInputInterface)
- Internalizes the object.
-
writeObject(StreamOutputInterface)
- Externalizes the object.
writeObject
public abstract void writeObject(StreamOutputInterface stream) throws StreamIOException
- Externalizes the object. By calling this method the object will
encode itself in a stream of data. Object implementors must
override this method to implement the writing of the object's attributes.
- Parameters:
- stream - the stream of data the object state is recorded in
- Throws: StreamIOException
- If a subobject does not implement the Streamable interface.
- See Also:
- readObject
readObject
public abstract void readObject(StreamInputInterface stream) throws StreamIOException
- Internalizes the object. By calling this method the object will
decode itself to a state defined by the data stream.
Object implementors must
override this method to implement the reading of the flattened object's
attribute values and to restore the state.
- Parameters:
- stream - the stream of data the object state is retrieved from
- Throws: StreamIOException
- If a class is not present or the input
data is corrupt
- See Also:
- writeObject
myStreamSize
public abstract int myStreamSize() throws StreamIOException
- Determines the size of the stream that would hold the externalized
form of the object. By calling this method the object will
compute the size of this data stream.
This method should be overriden in a
subclass to implement the reading of the flattened object's
attribute values and to restore the state.
- Parameters:
- stream - the stream the attribute values are written to
- Returns:
- the size of the stream in bytes
- Throws: StreamIOException
- If a subobject does not implement the
Streamable interface.
All Packages Class Hierarchy This Package Previous Next Index