Here you can find the source of deserialize(byte[] byteArray)
public static <T> T deserialize(byte[] byteArray)
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { public static <T> T deserialize(byte[] byteArray) { ObjectInputStream oip = null; try {/* w ww.j ava 2s.co m*/ oip = new ObjectInputStream(new ByteArrayInputStream(byteArray)); @SuppressWarnings("unchecked") T result = (T) oip.readObject(); return result; } catch (IOException e) { throw new IllegalArgumentException(e); } catch (ClassNotFoundException e) { throw new IllegalArgumentException(e); } finally { if (oip != null) { try { oip.close(); } catch (IOException e) { // eat it } } } } }