Here you can find the source of deserialize(byte[] objectData)
public static Object deserialize(byte[] objectData)
//package com.java2s; //License from project: Apache License import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.ObjectInputStream; public class Main { public static Object deserialize(byte[] objectData) { if (objectData == null) { throw new IllegalArgumentException("The byte[] must not be null"); }//from w w w . j ava 2 s .c o m ByteArrayInputStream bais = new ByteArrayInputStream(objectData); ObjectInputStream in = null; try { in = new ObjectInputStream(bais); return in.readObject(); } catch (ClassNotFoundException ex) { throw new RuntimeException(ex); } catch (IOException ex) { throw new RuntimeException(ex); } finally { try { if (in != null) { in.close(); } } catch (IOException ex) { // ignore close exception } } } }