File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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!!
It is sorta covered in the JavaRanch Style Guide.
subject: I/O Question
It's not a secret anymore!