CONTENTS | PREV | NEXT | Java Object Serialization Specification |
Objects implementingjava.io.Externalizable
must implement thewriteExternal
method to save the entire state of the object. It must coordinate with its superclasses to save their state. All of the methods ofObjectOutput
are 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 bywriteExternal
methods. Additionally, a tag denoting the end of the External object is appended to the stream after thewriteExternal
method returns. The benefits of this format change are discussed in Section 3.6, "The readExternal Method." Compatibility issues caused by this change are discussed in Section 2.6, "The useProtocolVersion Method."