Here you can find the source of deserialize(File file)
public static Object deserialize(File file) throws IOException, ClassNotFoundException
//package com.java2s; import java.io.BufferedInputStream; import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; public class Main { public static Object deserialize(File file) throws IOException, ClassNotFoundException { ObjectInputStream in = null; try {//w w w . ja v a2 s . com in = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file))); return in.readObject(); } finally { if (in != null) in.close(); } } public static Object deserialize(InputStream stream) throws IOException, ClassNotFoundException { ObjectInputStream in = null; try { in = new ObjectInputStream(stream); return in.readObject(); } finally { if (in != null) in.close(); } } public static void close(Closeable in) { try { if (in != null) { in.close(); } } catch (IOException e) { } } }