Here you can find the source of deserialize(byte[] data)
@SuppressWarnings("unchecked") public static <T> T deserialize(byte[] data)
//package com.java2s; //License from project: Open Source License import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.ObjectInputStream; public class Main { @SuppressWarnings("unchecked") public static <T> T deserialize(byte[] data) { ObjectInputStream ois = null; ByteArrayInputStream is = null; try {/*from w ww. j a v a2 s. co m*/ is = new ByteArrayInputStream(data); ois = new ObjectInputStream(is); return (T) ois.readObject(); } catch (Exception e) { e.printStackTrace(); } finally { if (ois != null) { try { is.close(); ois.close(); } catch (IOException e) { e.printStackTrace(); } } } return null; } }