Serializable


Serializable java.io

Java 1.1 serializable

The Serializable interface defines no methods or constants. A class should implement this interface simply to indicate that it allows itself to be serialized and deserialized with ObjectOutputStream.writeObject( ) and ObjectInputStream.readObject( ) .

Objects that need special handling during serialization or deserialization may implement one or both of the following methods; note, however, that these methods are not part of the Serializable interface):

 private void writeObject(java.io.ObjectOutputStream out) throws IOException; private void readObject(java.io.ObjectInputStream in) throws IOException,               ClassNotFoundException; 

Typically, the writeObject( ) method performs any necessary cleanup or preparation for serialization, invokes the defaultWriteObject( ) method of the ObjectOutputStream to serialize the nontransient fields of the class, and optionally writes any additional data that is required. Similarly, the readObject( ) method typically invokes the defaultReadObject( ) method of the ObjectInputStream , reads any additional data written by the corresponding writeObject( ) method, and performs any extra initialization required by the object. The readObject( ) method may also register an ObjectInputValidation object to validate the object once it is completely deserialized.

 public interface  Serializable  { } 

Implementations

Too many classes to list.

Passed To

java.security.SignedObject.SignedObject( ) , javax.crypto.SealedObject.SealedObject( )



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net