Here you can find the source of appendToFile(File tempFile, String str)
public static void appendToFile(File tempFile, String str) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static void appendToFile(File tempFile, String str) throws IOException { BufferedOutputStream fout = null; try {// w w w . j ava2s .com fout = new BufferedOutputStream(new FileOutputStream(tempFile, true)); fout.write(str.getBytes()); } finally { if (fout != null) fout.close(); } } }