Designing RMI Applications
ArrayList
are not serializable! transient
:
private transient Object myobject[];so it will not get serialized (be careful!)
private static final ObjectSreamField[] serialPersistentFields = { new ObjectStreamField("size", Integer.Type), ... };
private void writeObject(java.io.ObjectOutputStream out) throws IOException; private void readOject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException;these methods can invoke
defaultWriteObject()
to
invoke default serialization on the non-transient members.29 of 49