Here you can find the source of getBufferedWriter(String filePath, String encoding)
public static BufferedWriter getBufferedWriter(String filePath, String encoding) throws Exception
//package com.java2s; //License from project: Apache License import java.io.BufferedWriter; import java.io.FileOutputStream; import java.io.OutputStreamWriter; public class Main { public static BufferedWriter getBufferedWriter(String filePath, String encoding) throws Exception { return getBufferedWriter(filePath, encoding, false); }/*from ww w .j av a 2 s . c om*/ public static BufferedWriter getBufferedWriter(String filePath, String encoding, boolean append) throws Exception { OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(filePath, append), encoding); BufferedWriter bw = new BufferedWriter(osw); return bw; } }