I found the code for reading a hashMap from file (on disk):
public HashMap<String, Integer> load(String path)
{
try
{
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(path));
Object result = ois.readObject();
//you can feel free to cast result to HashMap<String, Integer> if you know that only a HashMap is stored in the file
return (HashMap<String, Integer>)result;
}
catch(Exception e)
{
e.printStackTrace();
}
}
but I did not find any example how does this file look like. Can you explain this with the help of an example ?