Here you can find the source of deserialize(String fileName)
public static Object deserialize(String fileName)
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { public static Object deserialize(String fileName) { ObjectInputStream ois = null; try {/*from w w w .j a v a2 s . co m*/ FileInputStream in = new FileInputStream(fileName); ois = new ObjectInputStream(in); return ois.readObject(); } catch (Exception e) { throw new RuntimeException(e); } finally { if (ois != null) { try { ois.close(); } catch (IOException e) { e.printStackTrace(); } } } } public static Object deserialize(byte[] b) { ObjectInputStream ois = null; try { ByteArrayInputStream in = new ByteArrayInputStream(b); ois = new ObjectInputStream(in); return ois.readObject(); } catch (Exception e) { throw new RuntimeException(e); } finally { if (ois != null) { try { ois.close(); } catch (IOException e) { e.printStackTrace(); } } } } }