A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
I/O and Streams
Best practice for PrintWriter?
Joined: Jan 22, 2004
Mar 20, 2012 07:34:25
I've currently got this code in my
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(new File("output.txt"), true))); out.println("Some text output, etc., etc.");
I've seen examples that don't use the
, so I'm wondering if the
really necessary / could including it or excluding it hurt performance?
NB - The output file is to record
results - about 100 characters are written to the file every second.
Joined: Oct 14, 2005
Mar 20, 2012 10:42:12
100 characters per second? No, buffering isn't going to make much difference on such a low volume of data.
I agree. Here's the link:
subject: Best practice for PrintWriter?
content-disposition & URLconnection
Is PrintWriter Buffered?
Printwriter vs Bufferedwriter
Writing data to a text file
PrintWriter won't write to a text file.....
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014