Java also supports writing and reading objects to stream (such as a file). The process of reading and writing objects in a file is called object serialization. Writing an object to a file is called serializing the object and reading the object back from a file is called deserializing an object. In Java, serialization occurs automatically. Objects can be converted into a sequence of bytes, or serialized, by using the java.io.ObjectOutputStream class and they can be deserialized or converted from bytes into a structured object, by using java.io.ObjectlnputStream class.