code: 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());
  	}
docs: Deserializes an object.
  @param bytes a non-null array of bytes
  @param clazz the class of the expected object
  @return the deserialized object, or null if it failed
  @throws IOException
  @throws ClassNotFoundException