|CONTENTS | PREV | NEXT||Java Object Serialization Specification|
java.io.Externalizablemust implement the
writeExternalmethod to save the entire state of the object. It must coordinate with its superclasses to save their state. All of the methods of
ObjectOutputare available to save the object's primitive typed fields and object fields.
public void writeExternal(ObjectOutput stream) throws IOException;A new default format for writing Externalizable data has been introduced in JDKTM 1.2. The new format specifies that primitive data will be written in block data mode by
writeExternalmethods. Additionally, a tag denoting the end of the External object is appended to the stream after the
writeExternalmethod returns. The benefits of this format change are discussed in Section 3.5, "The readExternal Method." Compatibility issues caused by this change are discussed in Section 2.6, "The useProtocolVersion Method."