Java tutorial
//package com.java2s; import java.io.*; public class Main { /** * Deserialize an array of bytes into an object. * @param input Serialized stream of bytes * @return Deserialized object. * @throws IOException * @throws ClassNotFoundException */ public static Serializable bytesToObject(byte input[]) throws IOException, ClassNotFoundException { return (Serializable) new ObjectInputStream(new ByteArrayInputStream(input)).readObject(); } }