Which Input Stream is Used for Deserialization in Java?
ObjectInputStream is the correct input stream for deserialization in Java. It allows you to read serialized objects from a file or other input source and reconstruct them in memory.
Here's a breakdown of why the other options are incorrect:
- FileWriter: Used for writing text data to files, not for reading serialized objects.
- FileReader: Used for reading text data from files, not for reading serialized objects.
- ObjectOutputStream: Used for writing serialized objects to files or other output sources. It's the counterpart to ObjectInputStream.
原文地址: https://www.cveoy.top/t/topic/ozVE 著作权归作者所有。请勿转载和采集!