Make PrintStream FasterPrintStream is useful for outputting line-oriented data. However, the obvious constructor suffers from a potential performance problem: every call to print() is followed by an automatic flush. autoflushing prevents standard write buffering from providing its usual performance benefits, even if the stream given to the PrintStream is a buffered one, like BufferedOutputStream. When PrintStream is used as part of a batch processing application that outputs a large amount of data, this problem can cause output to be much slower than it needs to be.
The solution is simple: use the two-parameter constructor and pass
Copyright © 2009 Andrew Oliver |