Here you can find the source of deserialize(final byte[] data)
public static final synchronized Object deserialize(final byte[] data) throws IOException, ClassNotFoundException
//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 final synchronized Object deserialize(final byte[] data) throws IOException, ClassNotFoundException { ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(data); ObjectInputStream is = new ObjectInputStream(byteArrayInputStream); return is.readObject(); }//ww w . ja v a 2s .c o m public static final synchronized Object deserialize(final Byte[] data) throws IOException, ClassNotFoundException { ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(toPrimitive(data)); ObjectInputStream is = new ObjectInputStream(byteArrayInputStream); return is.readObject(); } public static final synchronized byte[] toPrimitive(final Byte[] bytes) { byte[] primitiveBytes = new byte[bytes.length]; for (int i = 0; i < bytes.length; i++) { primitiveBytes[i] = bytes[i]; } return primitiveBytes; } }