Here you can find the source of appendFile(File filename, String data)
public synchronized static void appendFile(File filename, String data) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class Main { public synchronized static void appendFile(File filename, String data) throws IOException { try (BufferedWriter out = new BufferedWriter(new FileWriter(filename, true))) { out.write(data);// ww w. j av a 2s. c o m } } }