code: public static <T> T deSerialize( byte[] bytes, Class<T> adaptee ) throws Exception {
          ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
          Object readObject = in.readObject();
          return adaptee.cast(readObject);
      }
docs: Deserialize a byte array to a given object.
  
  @param bytes
  the byte array.
  @param adaptee
  the class to adapt to.
  @return the object.
  @throws Exception