O'Reilly logo

Java™ Network Programming and Distributed Computing by Michael Reilly, David Reilly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.5. Object Persistence and Object Serialization

Data that can be read or written ranges from individual bytes to primitive datatypes and strings. If you wanted to, for example, write a data structure (such as a sequence of data records, composed of individual fields) out to a file, you could do so. But what if you wanted to store an entire object, composed of a series of member variables?

To do this would require that each field of the object be written individually; then at a later time, each field would be read back and assigned to an object. This is a complicated process, particularly if some member variables are marked as private or protected. Yet saving data is one of the most important functions of software—unless you're writing trivial ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required