Interfaces ObjectOutput and ObjectInput

The ObjectOutput interface contains method writeObject, which takes an Object as an argument and writes its information to an OutputStream. A class that implements interface ObjectOutput (such as ObjectOutputStream) declares this method and ensures that the object being output implements interface Serializable (discussed shortly). Correspondingly, the ObjectInput interface contains method readObject, which reads and returns a reference to an Object from an InputStream. After an object has been read, its reference can be cast to the object’s actual type.

Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.