public static Object byteArrayToObject ( final byte [ ] data ) throws IOException , ClassNotFoundException { Object retObj = null ; ByteArrayInputStream bais = new ByteArrayInputStream ( data ) ; ObjectInputStream ois = null ; try { ois = new ObjectInputStream ( bais ) ; retObj = ois . readObject ( ) ; } finally { StreamUtil . close ( ois ) ; } return retObj ; }
De - serialize an object from byte array .