aspose file tools*
The moose likes I/O and Streams and the fly likes Do I need to use a stringbuffer? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Do I need to use a stringbuffer?" Watch "Do I need to use a stringbuffer?" New topic
Author

Do I need to use a stringbuffer?

john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

Here is a part of my code simplified for my question:

Do I need to use the StringBuffer at all?
Thanks,
cc11rocks aka John Price


“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2090
    
    7
Do I need to use the StringBuffer at all?


To do what?

What is your requirement? We are not mind readers!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18109
    
    8

I wouldn't say you don't NEED it... but you create it and then append null to it. That's all you do. There must be an easier way to do that.
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

It was part of some previous code I had received. I think I do not need it. I removed it and it is working fine.
Thank you guys,
John Price aka cc11rocks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Do I need to use a stringbuffer?
 
Similar Threads
will file reading use up jvm or memory?
Scanner class
How to i save add the contents of the file to StringBuffer?
Issue with reading from a file
Reading and displaying Strings from a file