Here you can find the source of deserializeMyContext(String path)
private static Object deserializeMyContext(String path) throws Exception
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { private static Object deserializeMyContext(String path) throws Exception { File file = new File(path); InputStream fis = new FileInputStream(file); ObjectInputStream ois = null; Object object = null;/*from ww w. j av a 2 s. co m*/ try { ois = new ObjectInputStream(fis); object = ois.readObject(); } catch (Exception e) { e.printStackTrace(); } finally { if (fis != null) { fis.close(); } if (ois != null) { ois.close(); } fis.close(); } return object; } }