Section 15.5 Object Serialization
• Java provides a mechanism called object serialization (p. 662) that enables entire objects to be written to or read from a stream.
• A serialized object (p. 662) is represented as a sequence of bytes that includes the object’s data as well as information about the object’s type and the types of data it stores.
• After a serialized object has been written into a file, it can be read from the file and deserialized (p. 662) to recreate the object in memory.
• Classes ObjectInputStream (p. 662) and ObjectOutputStream (p. 662) enable entire objects to be read from or written to a stream (possibly a file).
• Only classes that implement interface Serializable (p. 663) can be serialized and deserialized.
• The ObjectOutput ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access