|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A Streamable object is able to write it's state to an output stream and a class implementing Streamable must be able to recreate an instance of the class from an input stream. No information about class name is written to the output stream so it must be known what class type is expected when reading objects back in from an input stream. This gives a space advantage over Serializable.
Since the exact class must be known anyway prior to reading, it is incouraged that classes implementing Streamble also provide a constructor of the form:
Streamable(DataInput in) throws IOException;
| Method Summary | |
|---|---|
void |
fromStream(DataInput out)
Reads the internal state of the Streamable object from the input stream. |
void |
toStream(DataOutput out)
Writes the internal state of the Streamable object to the output stream in a format that can later be read by the same Streamble class using the fromStream(java.io.DataInput) method. |
| Method Detail |
|---|
void toStream(DataOutput out)
throws IOException
fromStream(java.io.DataInput) method.
IOException
void fromStream(DataInput out)
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||