code: @SuppressWarnings("unchecked")
      public static <T> T readObject(InputStream is) {
          try {
              ObjectInputStream ois = new ObjectInputStream(is);
              T ret = (T) ois.readObject();
              ois.close();
              return ret;
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
  
      }
docs: Reads an object from the given input stream
  @param is the input stream to read from
  @return the read object