Here you can find the source of deserialize(byte[] in)
public static Object deserialize(byte[] in)
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { public static Object deserialize(byte[] in) { return deserialize(in, Object.class); }/*from w w w . j a va 2 s . c o m*/ @SuppressWarnings("unchecked") public static <T> T deserialize(byte[] in, Class<T> requiredType) { Object rv = null; ByteArrayInputStream bis = null; ObjectInputStream is = null; try { if (in != null) { bis = new ByteArrayInputStream(in); is = new ObjectInputStream(bis); rv = is.readObject(); } } catch (Exception e) { e.printStackTrace(); System.out.println("deserialize error"); } finally { close(is); close(bis); } return (T) rv; } private static void close(Closeable closeable) { if (closeable != null) try { closeable.close(); } catch (IOException e) { e.printStackTrace(); System.out.println("close stream error"); } } }