Using a BufferedReader and BufferedWriter, is there a way to append to a file rather an overwriting it? Right now I read in the entire file and rewrite it which seems pretty slow.
Printable View
Using a BufferedReader and BufferedWriter, is there a way to append to a file rather an overwriting it? Right now I read in the entire file and rewrite it which seems pretty slow.
public FileOutputStream(String name, boolean apppend) throws FileNotFoundException
or
public FileWriter(String name, boolean append) throws IOException
What i don't understand is that Java stress writing "pure Java" which means hard coding of files names should not be done. So then why do they add an append parameter to only the constructors that take a hard coded string as an arguement?
Java is a funky beast. :)
Thanks, Dilenger.
:eek: Buy the way nice web site you have. Great layout, and the content is pretty good too. :p