Java tutorial
//package com.java2s; import java.io.*; public class Main { static public Object setObjectBytes(byte[] b) throws IOException, ClassNotFoundException { ByteArrayInputStream baos = new ByteArrayInputStream(b); ObjectInputStream oos = new ObjectInputStream(baos); oos.close(); return oos.readObject(); } }