Here you can find the source of getBufferedWriter(String path, String charset, boolean isAppend)
public static BufferedWriter getBufferedWriter(String path, String charset, boolean isAppend) throws IOException
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { public static BufferedWriter getBufferedWriter(String path, String charset, boolean isAppend) throws IOException { return new BufferedWriter(new OutputStreamWriter(new FileOutputStream(touch(path), isAppend), charset)); }//from w w w .j a v a2 s . co m public static File touch(String fullFilePath) throws IOException { if (fullFilePath == null) { return null; } File file = new File(fullFilePath); file.getParentFile().mkdirs(); if (!file.exists()) file.createNewFile(); return file; } }