class IOHelpers {
  private IOHelpers() {
    throw new IllegalStateException("Utility class");
  }

  public static String readFully(InputStream in, Charset charset) throws IOException {
    Reader r = new BufferedReader(new InputStreamReader(in, charset));
    return readFully(r);
  }

  public static String readFully(InputStream in) throws IOException {
    return readFully(in, Charset.defaultCharset());
  }

  public static String readFully(Reader r) throws IOException {
    try (StringWriter w = new StringWriter()) {
      copy(r, w);
      return w.toString();
    }
  }

  private static void copy(Reader reader, Writer writer) throws IOException {<FILL_FUNCTION_BODY>}

  /**
   * @deprecated will be removed in future versions
   */
  @Deprecated
  public static boolean isJSONValid(String json) {
    try {
      ObjectMapper objectMapper = Serialization.jsonMapper();
      objectMapper.readTree(json);
    } catch (JsonProcessingException e) {
      return false;
    }
    return true;
  }

  /**
   * @deprecated will be removed in future versions
   */
  @Deprecated
  public static String convertYamlToJson(String yaml) {
    return Serialization.asJson(Serialization.unmarshal(yaml, JsonNode.class));
  }

  /**
   * @deprecated will be removed in future versions
   */
  @Deprecated
  public static String convertToJson(String jsonOrYaml) {
    if (isJSONValid(jsonOrYaml)) {
      return jsonOrYaml;
    }
    return convertYamlToJson(jsonOrYaml);
  }

}

    char[] buffer = new char[8192];
    int len;
    for (;;) {
      len = reader.read(buffer);
      if (len > 0) {
        writer.write(buffer, 0, len);
      } else {
        writer.flush();
        break;
      }
    }
  
<no_super_class>