ObjectOutputStream
ObjectOutputStream is a Java I/O class in the java.io package that writes primitive data and object graphs to an OutputStream using Java’s built-in serialization mechanism. It enables persisting objects to files, sending objects over networks, or otherwise encoding data for later deserialization.
Serialization with ObjectOutputStream requires that the classes of the objects being written implement the Serializable interface.
Core functionality is exposed through methods such as writeObject(Object), which serializes an object, and various write
Usage typically involves wrapping an OutputStream, such as a FileOutputStream or ByteArrayOutputStream, with a new ObjectOutputStream.