Java tutorial
//package com.java2s; //License from project: Open Source License import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.ObjectInputStream; public class Main { public static Object byteToObject(byte[] data) throws IOException, ClassNotFoundException { ByteArrayInputStream inputStream = new ByteArrayInputStream(data); ObjectInputStream is = new ObjectInputStream(inputStream); return is.readObject(); } }