Thread: BufferedReader
View Single Post
Old Apr 5th, 2006, 3:14 AM   #3
Eric the Red
Hobbyist Programmer
 
Eric the Red's Avatar
 
Join Date: Feb 2006
Posts: 214
Rep Power: 0 Eric the Red is an unknown quantity at this point
Quote:
Originally Posted by titaniumdecoy
If you really want to rewind the BufferedReader, you'll find the mark() and reset() methods useful.

However, I suggest that instead you store all the data you read in from the BufferedReader initially, close() it, and use the data you have already stored rather than rereading it.

For example, why not replace

c.print ("first line 1: " + input2.readLine());
with

c.print ("first line 1: " + inputStringFinal[0]);
Thanks you!! you were right. better to read in the entire file first.
__________________
Death smiles at us all. All a man can do is smile back.
Eric the Red is offline   Reply With Quote