goja-core/src/main/java/goja/core/kits/stream/StreamUtil.java
public static void copy(Reader input, OutputStream output, String encoding) throws IOException {
        Writer out = new OutputStreamWriter(output, encoding);
        copy(input, out);
        out.flush();
    }
public static void copy(Reader input, OutputStream output, String encoding) throws IOException {
        Writer out = new OutputStreamWriter(output, encoding);
        copy(input, out);
        out.flush();
    }
Copies reader to output stream using buffer and specified encoding.