ObjectInputStream in Java can be used to convert InputStream to object. The process of converting the input stream to an object is called deserialization. In last post, we learned about ObjectOutputStream and converted java object to output stream and write to file. Here we will read the same serialized file to create an object in java.
Java中的ObjectInputStream可用于将InputStream转换为对象。 将输入流转换为对象的过程称为反序列化。 在上一篇文章中,我们了解了ObjectOutputStream并将Java对象转换为输出流并写入文件。 在这里,我们将读取相同的序列化文件以在Java中创建一个对象。