Here you can find the source of getBufferedWriter(File f)
public static BufferedWriter getBufferedWriter(File f)
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.util.HashMap; public class Main { public static HashMap<File, BufferedWriter> writers = new HashMap<File, BufferedWriter>(); public static BufferedWriter getBufferedWriter(File f) { try {/*from w w w . j a v a 2s . co m*/ if (writers.containsKey(f)) { return writers.get(f); } else { BufferedWriter returns = new BufferedWriter(new FileWriter(f, true)); writers.put(f, returns); return returns; } } catch (Exception e) { e.printStackTrace(); return null; } } }