When process of serializing an object is to be controlled then Externalizable interface is used.The Externizable interface extends Serializable and adds two methods,writeExternal() and readExternal() which are automatically called during serialization and deserialization.
Classes that require special handling during the serialization and deserialization process must implement special methods with these exact signatures:
private void writeObject(java.io.ObjectOutputStream out) throws IOException
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException;


0 comments:
Post a Comment