code: public static Object bytesToObject(byte[] bytes) throws IOException,
        ClassNotFoundException {
      ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
      ObjectInputStream is = new ObjectInputStream(bais);
      return is.readObject();
    }
docs: Converts a byte array to a serializable object.