
-----------------------------------
HeavenAgain
Thu Nov 01, 2007 11:23 pm

file output
-----------------------------------
whats the standard file output for java now?
i'm using PrintWriter + BufferedWriter + FileWriter is it out dated? :|

and another question for PrintWriter, if i were to use it to write a file, it will always start at the beginning of the file, but say theres already something in the file, and i dont want to over write it, how do i skip all those and go to the end? any special method?

-----------------------------------
Euphoracle
Fri Nov 02, 2007 2:50 pm

RE:file output
-----------------------------------
You can just do something like

PrintStream pr =  new PrintStream(new FileWriter(...));
pr.println("Bacon");
pr.print("eg");
pr.print("gs\n");

-----------------------------------
HeavenAgain
Fri Nov 02, 2007 3:10 pm

RE:file output
-----------------------------------
what about skipping to the end of the file instead of over writing?

-----------------------------------
Euphoracle
Fri Nov 02, 2007 5:41 pm

RE:file output
-----------------------------------
Add the argument `append` (second one for FileWriter contructor) the value of `true`.
