private static Writer makeWriter(OutputStream out, String enc)
    throws UnsupportedEncodingException {
    // "UTF-8" is not recognized before JDK 1.1.6, so we'll translate
    // into "UTF8" which works with all JDKs.
    if ("UTF-8".equals(enc)) {
      enc = "UTF8";
    }

    return new BufferedWriter(
      (new OutputStreamWriter(
        new BufferedOutputStream(out), enc)
      ));
  }
private static Writer makeWriter(OutputStream out, String enc)