3.2.5 Binary Input and Output3.2.4 Text Output3.2 Streams and Files3.2.5.1 Object Serialization

3.2.5 Binary Input and Output

We demonstrate the use of raw byte streams by a concrete application: the storing of objects on disk and their restoration in memory. Typically our programs not only operate on primitive datatypes but on objects, arrays of objects, or other complex structures. Of course, we could write code that stores the individual fields of an object and reconstruct the object when it is read back in. However, this is a tedious and error-prone process and Java provides a better concept, that of object serialization.


© Wolfgang Schreiner; February 3, 2005

3.2.5 Binary Input and Output3.2.4 Text Output3.2 Streams and Files3.2.5.1 Object Serialization