org.iperg.part.core
Interface IpSerializable

All Known Implementing Classes:
IpIdentifier, IpNetworkEvent, IpObjectPattern

public interface IpSerializable

The IpSerializable interface specifies methods that allows an object's state to be serialized to and from a byte stream.

Serialization and deserialization is implemented via the write and read methods. The write method is responsible for writing the state of the object for its particular class so that the corresponding read method can restore it. The state typically consist of the values of the objects class variables, but it's really up to each class to decide what constitutes its state. Both the write and the read method does not need to concern themselves with the state belonging to its superclasses or subclasses.

Version:
1.0.0 Initial version
Author:
Olov Stahl - olovs@sics.se

Method Summary
 void read(IpInputStream stream)
          Read the object's state from an input stream.
 void write(IpOutputStream stream)
          Write the state of the object into an output stream.
 

Method Detail

write

void write(IpOutputStream stream)
           throws java.io.IOException
Write the state of the object into an output stream.

Parameters:
stream - The output stream into which the object's state should be written
Throws:
java.io.IOException - if an io exception occurs while writing data to the stream

read

void read(IpInputStream stream)
          throws java.io.IOException
Read the object's state from an input stream.

Parameters:
stream - The input stream from which the object's state should be read
Throws:
java.io.IOException - if an io exception occurs while reading data from the stream