public static < T extends Serializable > T deserializeObject ( byte [ ] bytes , Class < T > clazz ) throws IOException , ClassNotFoundException { ByteArrayInputStream is = new ByteArrayInputStream ( bytes ) ; ObjectInputStream deserializer = new ObjectInputStream ( is ) ; return clazz . cast ( deserializer . readObject ( ) ) ; }
Deserializes an object .