mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8275013: Improve discussion of serialization method declarations in java.io.Object{Input, Output}Stream
Reviewed-by: smarks, rriggs
This commit is contained in:
parent
da8da3a161
commit
8c4da9c15f
2 changed files with 18 additions and 5 deletions
|
@ -145,8 +145,8 @@ import sun.security.action.GetIntegerAction;
|
|||
* entire graphs.
|
||||
*
|
||||
* <p>Serializable classes that require special handling during the
|
||||
* serialization and deserialization process should implement the following
|
||||
* methods:
|
||||
* serialization and deserialization process should implement methods
|
||||
* with the following signatures:
|
||||
*
|
||||
* <pre>
|
||||
* private void writeObject(java.io.ObjectOutputStream stream)
|
||||
|
@ -157,6 +157,12 @@ import sun.security.action.GetIntegerAction;
|
|||
* throws ObjectStreamException;
|
||||
* </pre>
|
||||
*
|
||||
* <p>The method name, modifiers, return type, and number and type of
|
||||
* parameters must match exactly for the method to be used by
|
||||
* serialization or deserialization. The methods should only be
|
||||
* declared to throw checked exceptions consistent with these
|
||||
* signatures.
|
||||
*
|
||||
* <p>The readObject method is responsible for reading and restoring the state
|
||||
* of the object for its particular class using data written to the stream by
|
||||
* the corresponding writeObject method. The method does not need to concern
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue