code: public static String readFully(BufferedReader reader) throws IOException {
      StringBuilder sb = new StringBuilder();
      for (String line; (line = reader.readLine()) != null; ) {
        sb.append(line);
      }
      return sb.toString();
    }
docs: Reads the give {@code BufferedReader} into a String.