Computing.Net > Forums > Programming > java BufferedReader question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

java BufferedReader question

Reply to Message Icon

Name: osaru
Date: March 27, 2004 at 21:50:59 Pacific
OS: win
CPU/Ram: 512M
Comment:

In Java, when I read a line by executing .readLine(), the pointer gets to point the begining of the next line in a stream. My question is if there is any way to go back to the begining of the previous line. Is this possible?
thanks



Sponsored Link
Ads by Google

Response Number 1
Name: gpp
Date: March 29, 2004 at 07:14:59 Pacific
Reply:

There are two methods for this, mark() and reset()... use mark() to keep track of that particular postion in the stream, and use reset to get back to that position. I'm not sure what you have in mind, but its not quite like rolling back a transaction in the database or something like that. You have to give mark() a read-ahead limit, and if you pass that limit and try a reset, it will probably fail.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: java BufferedReader question

Java Method Question www.computing.net/answers/programming/java-method-question/14684.html

Java noob question www.computing.net/answers/programming/java-noob-question/13768.html

Java VM question www.computing.net/answers/programming/java-vm-question/11263.html