This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes I/O Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "I/O Question" Watch "I/O Question" New topic

I/O Question

Rob Levo
Ranch Hand

Joined: Oct 01, 2000
Posts: 167
I need example code of reading the contents of a file into a StringBuffer object.
Thanks to anyone who can provide that example for me.
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
This should do the trick. I even added a line to spit the contents back out to the console so that you could see what was in the StringBuffer.

I hope that helps,
[ April 18, 2002: Message edited by: Corey McGlone ]

SCJP Tipline, etc.
Rob Levo
Ranch Hand

Joined: Oct 01, 2000
Posts: 167
Thanks Corey, exactly what I needed!!
I agree. Here's the link:
subject: I/O Question
Similar Threads
What is the plural of Algorithm ?
How do you print a character a random number of times?
Mashups: A Java Thing?
Sub class name- qualify clause
System.err or System.out