This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Best practice for PrintWriter? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Best practice for PrintWriter?" Watch "Best practice for PrintWriter?" New topic

Best practice for PrintWriter?

James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401

I've currently got this code in my servlet:

I've seen examples that don't use the BufferedWriter, so I'm wondering if the BufferedWriter really necessary / could including it or excluding it hurt performance?

NB - The output file is to record test results - about 100 characters are written to the file every second.

Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

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?
Similar Threads
Writing data to a text file
Printwriter vs Bufferedwriter
PrintWriter won't write to a text file.....
content-disposition & URLconnection
Is PrintWriter Buffered?