Hi , I have a question about custom serialization. I read about serialization on sun'web site. http://developer.java.sun.com/developer/technicalArticles/Programming/serialization/ According to the above document, if i want to change the way i control serialization and deserialization process , i need to overide writeObject and readObject method. But if i want to have the total control ( including the methods used for serilaization)i need to implement Externalizable interface which has readExternal and writeExternal methods. So i guess, in the first case it is using java standard object serialization. But in case of Externalizable interface, i can specify my own serialization mechanism. Please correct me, if the above statement is wrong. If i decide to implement Externalizable, can some one provide me links where i can find examples of such implementation. can some one throw light on the techniques and methods to improve the serialization ( example improving the speed of serialization). Thanks very much for your time. Thanks Praveen.
Maulin Vasavada
Ranch Hand
Joined: Nov 04, 2001
Posts: 1865
posted
0
hi Praveen ur prediction about how serializable and externalizable used is correct. serializable customization via implementing private void writeObject() and readObject() uses standard mechanism and used in special cases like one mentioned in the link you provided (that PersistanceThread thing) and externalizable is used to have complete control over things.. it seems both of ur questions, 1. provide an example using Externalizable 2. how to improve serialization performance can probably answered by, JDC Tech Tip