public static Object readObjectFromFile ( File file ) throws IOException , ClassNotFoundException { FileInputStream fs = new FileInputStream ( file ) ; ObjectInputStream os = new ObjectInputStream ( fs ) ; Object object = os . readObject ( ) ; os . close ( ) ; return object ; }
Reads a single object from a file .