Here you can find the source of loadData(HashMap data, String filename)
@SuppressWarnings("rawtypes") public static HashMap loadData(HashMap data, String filename)
//package com.java2s; //License from project: LGPL import java.io.FileInputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.util.HashMap; public class Main { @SuppressWarnings("rawtypes") public static HashMap loadData(HashMap data, String filename) { try {//from w ww. j a v a2s .co m data = (HashMap) readObject(filename); } catch (IOException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } return data; } private static Object readObject(String filename) throws IOException, ClassNotFoundException { FileInputStream fileIn = new FileInputStream(filename); ObjectInputStream in = new ObjectInputStream(fileIn); Object data = in.readObject(); in.close(); fileIn.close(); return data; } }