Here you can find the source of getWriter(OutputStream out, String charsetName)
public static OutputStreamWriter getWriter(OutputStream out, String charsetName)
//package com.java2s; //License from project: Apache License import java.io.OutputStream; import java.io.OutputStreamWriter; import java.nio.charset.Charset; public class Main { public static OutputStreamWriter getWriter(OutputStream out, String charsetName) { return getWriter(out, Charset.forName(charsetName)); }/* w w w. j a va 2s . com*/ public static OutputStreamWriter getWriter(OutputStream out, Charset charset) { if (null == out) { return null; } if (null == charset) { return new OutputStreamWriter(out); } else { return new OutputStreamWriter(out, charset); } } }