public void bar(String fileName) throws IOException{
FileInputStream fileIn = new FileInputStream(fileName);
ObjectInputStream in = new ObjectInputStream(fileIn);
Map map = (HashMap) in.readObject();
}
I’m trying to understand what this piece of code does.
We create a stream, so we’ll be able to read from this file. What does this ObjectInputStream do? Do we read object and make a map out of it? I clearly don’t understand, and I’ll be glad for your help.
My guess is it is reading a
HashMapthat was previously written to the file using correspondingOut/Writemethods.