Here you can find the source of deserialize(String fname)
public static Object deserialize(String fname)
//package com.java2s; // This software is released under the 2-clause BSD license. import java.io.*; import java.util.zip.*; public class Main { public static Object deserialize(String fname) { return deserialize(new File(fname), false); }//from w w w . j ava 2 s .c om public static Object deserialize(String fname, boolean gzipped) { return deserialize(new File(fname), gzipped); } public static Object deserialize(File f) { return deserialize(f, false); } public static Object deserialize(File f, boolean gzipped) { try { InputStream is = new FileInputStream(f); if (gzipped) is = new GZIPInputStream(is); ObjectInputStream ois = new ObjectInputStream(is); Object obj = ois.readObject(); ois.close(); return obj; } catch (Exception e) { throw new RuntimeException(e); } } }