Here you can find the source of deserialize(byte[] bytes)
public static Object deserialize(byte[] bytes)
//package com.java2s; //License from project: Apache License import java.io.ByteArrayInputStream; import java.io.ObjectInputStream; public class Main { public static Object deserialize(byte[] bytes) { Object result = null;/*from ww w .j a v a 2 s . c om*/ if (isEmpty(bytes)) { return null; } try { ByteArrayInputStream byteStream = new ByteArrayInputStream(bytes); try { ObjectInputStream objectInputStream = new ObjectInputStream(byteStream); try { result = objectInputStream.readObject(); } catch (ClassNotFoundException ex) { throw new Exception("Failed to deserialize object type", ex); } } catch (Throwable ex) { throw new Exception("Failed to deserialize", ex); } } catch (Exception e) { // logger.error("Failed to deserialize",e); } return result; } public static boolean isEmpty(byte[] data) { return (data == null || data.length == 0); } }