Code example for ObjectInputStream

Methods: closereadObject

public final class Utilities 
	public static HashMap<Integer, MetaData> LoadLocalMetadata(String filename) throws ClassNotFoundException, IOException 
		FileInputStream fin = new FileInputStream(filename);
		ObjectInputStream oin = new ObjectInputStream(fin);
		HashMap<Integer, MetaData> ret = (HashMap<Integer, MetaData>) oin.readObject();
		return ret;
	public static void SaveLocalMetadata(String filename, HashMap<Integer, MetaData> metadata) throws IOException
		FileOutputStream fout = new FileOutputStream(filename);
		ObjectOutputStream oout = new ObjectOutputStream(fout);
Connect your IDE to all the code out there  Get Codota for Java