Java tutorial
//package com.java2s; import java.io.ByteArrayInputStream; import java.io.ObjectInputStream; public class Main { public static Object byteToObject(byte[] bytes) throws Exception { ObjectInputStream ois = null; try { ois = new ObjectInputStream(new ByteArrayInputStream(bytes)); return ois.readObject(); } finally { if (ois != null) ois.close(); } } }