code works fine, appends to end of file like the boolean flag on FileWriter specifies (FileWriter(String fileName, boolean append) Constructs a FileWriter object given a file name with a boolean indicating whether or not to append the data written. - from java docs).