Here you can find the source of appendTextToFile(String text, File file)
public static void appendTextToFile(String text, File file)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static void appendTextToFile(String text, File file) { try (FileOutputStream fileOutputStream = new FileOutputStream(file, true)) { fileOutputStream.write(text.getBytes()); } catch (IOException e) { throw new RuntimeException("Error while appending text to file", e); }//w w w. j av a 2 s .com } }