Here you can find the source of deserializeObjectFromByteArray(byte[] data)
@SuppressWarnings("unchecked") public static <T> T deserializeObjectFromByteArray(byte[] data) throws IOException, ClassNotFoundException
//package com.java2s; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.ObjectInputStream; public class Main { /** Read the object from Base64 string. */ @SuppressWarnings("unchecked") public static <T> T deserializeObjectFromByteArray(byte[] data) throws IOException, ClassNotFoundException { if (data == null) return null; ObjectInputStream ois = new ObjectInputStream( new ByteArrayInputStream(data)); Object o = ois.readObject(); ois.close();//from w ww .java 2 s . c o m return (T) o; } }