public interface Externalizable extends Serializable
ObjectOutputStream
,
ObjectInputStream
,
ObjectOutput
,
ObjectInput
,
Serializable
Modifier and Type | Method and Description |
---|---|
void |
readExternal(ObjectInput in)
The object implements the readExternal method to restore its
contents by calling the methods of DataInput for primitive
types and readObject for objects, strings and arrays.
|
void |
writeExternal(ObjectOutput out)
The object implements the writeExternal method to save its contents
by calling the methods of DataOutput for its primitive values or
calling the writeObject method of ObjectOutput for objects, strings,
and arrays.
|
void writeExternal(ObjectOutput out) throws IOException
out
- the stream to write the object toIOException
- Includes any I/O exceptions that may occurvoid readExternal(ObjectInput in) throws IOException, ClassNotFoundException
in
- the stream to read data from in order to restore the objectIOException
- if I/O errors occurClassNotFoundException
- If the class for an object being
restored cannot be found.