In this example we will see how we can use Java’s ObjectInputStream and ObjectOutputStream classes to serialize objects and store them as a file or any other storage accessible by Output Stream; read them again, deserialize it into an object and use it. ObjectOutputStream Example So, first we will see how to write an object into a File using FileOutputStream ...
Read More »How to Read an Object from File in Java
In the previous tutorial we saw how to write an Object to a file in Java. In this example we are going to see how to read an Object from the file that we’ve stored it earlier. Basically, to read an Object from a file, one should follow these steps: Open a FileInputStream to the file that you’ve stored the ...
Read More »