Package java.io
Interface Externalizable
- All Superinterfaces:
Serializable
public interface Externalizable extends Serializable
Defines an interface for classes that want to be serializable, but have their
own binary representation.
-
Method Summary
Modifier and Type Method Description voidreadExternal(ObjectInput input)Reads the next object from the ObjectInputinput.voidwriteExternal(ObjectOutput output)Writes the receiver to the ObjectOutputoutput.
-
Method Details
-
readExternal
Reads the next object from the ObjectInputinput.- Parameters:
input- the ObjectInput from which the next object is read.- Throws:
IOException- if an error occurs attempting to read frominput.ClassNotFoundException- if the class of the instance being loaded cannot be found.
-
writeExternal
Writes the receiver to the ObjectOutputoutput.- Parameters:
output- the ObjectOutput to write the object to.- Throws:
IOException- if an error occurs attempting to write tooutput.
-