JAVA object serialization

two articals :
http://java.sun.com/developer/technicalArticles/Programming/serialization/
http://www.acm.org/crossroads/xrds4-2/serial.html

my first glance about object serialization :

Java provide object serialization to allow save or retrive data in a way of object. A so-called serialized object is an object reperesented as a sequence of bytes that include both information about the data and the type of those data and the object.

Before an object of a class can be serialized, the class must implement the interface "Serializable".

In a class that implements "Serializable", programmer must be sure every instance variable that is a serializable type. Any instance variable that is not serializable must be declared "transient" to indicate that it is not serializable and should be ignored during the serialization process.

Array object are serializable, however, if the array contains references to other objects that is not serializable, those objects may or may not be serializable.

When talking about object stream:

Initializing stream objects with other stream objects is called wrapping.

When using wrapped streams, closing the outermost stream also closes the underlying file.

评论

此博客中的热门博文

Nu förbjuder Kina handel med elfenben

Fader av pingyins

Kineserna vill köpa Volvos kompetens