What is the role of the ObjectOutputStream class in serialization?

  • It handles user input for serialization
  • It performs encryption on serialized data
  • It reads objects from a stream
  • It serializes objects into a byte stream
The ObjectOutputStream class in Java is used to serialize objects into a byte stream. It's responsible for writing the state of an object to the output stream. Conversely, ObjectInputStream is used for reading serialized objects from a stream. It is an essential part of Java's serialization mechanism.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *