public interface Externalizable extends Serializable
ObjectOutputStream
,
ObjectInputStream
,
ObjectOutput
,
ObjectInput
,
Serializable
Modifier and Type | Method and Description |
---|---|
void |
readExternal(ObjectInput
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
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(ObjectOutputout) throws IOException
out
- the stream to write the object to
IOException
- Includes any I/O exceptions that may occur
void readExternal(ObjectInputin) throws IOException , ClassNotFoundException
in
- the stream to read data from in order to restore the object
IOException
- if I/O errors occur
ClassNotFoundException
- If the class for an object being restored cannot be found.