I'm not sure, what stupidity I'm doing here. But I'm trying to serialize a collection of Person objects, collected in a HashSet. I know that serialization part is working fine. but coming to deserialization, I have been trying some thing like below
When I invoke ois.readObject() , it is returning me the object, but when I invoke available() it is returning 0 and Exception when readInt() is called.
I wanted to call
Is the above code not the correct way of iterating over serialized objects.