Code example for ObjectInputStream

Methods: closereadObject

0
		oos.close();
	} 
 
	@SuppressWarnings("unchecked") 
	public static <T extends Object> T load(String path) throws FileNotFoundException, IOException, ClassNotFoundException  {
		ObjectInputStream ois = new ObjectInputStream(new FileInputStream(path));
		T result = (T) ois.readObject();
		ois.close();
		return result;
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE