A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
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?
Writing data to a text file
PrintWriter won't write to a text file.....
Printwriter vs Bufferedwriter
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014