Here you can find the source of loadSerializedObject(String fileName)
public static Object loadSerializedObject(String fileName)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static Object loadSerializedObject(String fileName) { Object object = null;/*from ww w .j a va 2 s.co m*/ try { InputStream file = new FileInputStream(fileName); InputStream buffer = new BufferedInputStream(file); ObjectInput input = new ObjectInputStream(buffer); try { object = input.readObject(); } finally { input.close(); } } catch (ClassNotFoundException cnfEx) { System.err.println(fileName); cnfEx.printStackTrace(); } catch (IOException ioex) { System.err.println(fileName); ioex.printStackTrace(); } return object; } }