Rob
SCJP 1.4
Originally posted by Rob Ross:
On top of this, you can create your own buffer in java. You are doing so by writing everything to a StringBuffer first. Another way to do it is simply use a BufferedOutputStream. It will let you buffer your output and use the same OutputStream API, and you won't have to do something special like write to a StringBuffer.
<SNIP>
You will have a slight performance hit when you copy the StringBuffer data to a String object via the toString() method. If the data in the STringBuffer is small, and you are not writing it that often, this extra step will probably not be noticeable. However, if you're filling your STringBuffer with a lot of data in a loop that gets executed many times, this extra step may become a performance bottleneck. It really depends on your particular programming situation.
"I'm not back." - Bill Harding, Twister
Rob
SCJP 1.4
"I'm not back." - Bill Harding, Twister
please buy this thing and then I get a fat cut of the action:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|