Serialization
in Java |
Prof. David Bernstein
|
Computer Science Department |
bernstdh@jmu.edu |
ObjectOutputStream
maintains a mapping from
instances and classes to handles.
writeObject( )
is passed an instance that has
not yet been written to the stream the instance is assigned a
reference handle, the handle is written to the stream, and the
instance data is written to the stream.
writeObject()
is called with an argument that has
already been written to the stream, the handle is written to the
stream, and no further operations are necessary.
transient
private void readObject(ObjectInputStream stream)
private void writeObject(ObjectOutputStream stream)
writeObject()
and readObject()
methods that always throw the NotSerializableException
ObjectOutputStream
which will abort the serialization
process.
writeReplace()
and
readReplace()
methods