Here you can find the source of appendStringToFile(String fileName, String data)
public static boolean appendStringToFile(String fileName, String data)
//package com.java2s; /** This class is a PanelLeft factory, creating all panels based on the * contents of the panels.xml file.// ww w . ja va2 s. c o m * * Last Updated: May 25, 2011 * * by Rick C. Hodgin * Cossatot Analytics Laboratories, LLC. (Cana Labs) * * (c) Copyright Cana Labs. * Free software licensed under the GNU GPL2. * * @author Rick C. Hodgin * @version 1.0.0 * * Change history: * 2011-05-25 - 1.0.0 - Initial release * */ import java.io.DataOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class Main { public static boolean appendStringToFile(String fileName, String data) { int i; try { File f; FileOutputStream fo; f = new File(fileName); fo = new FileOutputStream(f, true); DataOutputStream dos = new DataOutputStream(fo); // Write each item in turn dos.writeBytes(data); dos.close(); return (true); } catch (FileNotFoundException ex) { } catch (IOException ex) { } return (false); } }