Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

mark/reset method not supported for InputStream?

807589Sep 12 2008 — edited Sep 12 2008
Hi. I am working on a program and I basically want to mark the stream so that I can come back to it if I find a certain keyword in the current section of the stream I'm reading at. However, I get "java.io.IOException:mark/reset not supported" and I used the markSupported() method to check and it verifies that it is not supported. I just wanted to know that by using an InputStream object, is there any way I can use other similiar mark/reset methods or maybe use another stream class so that I can achieve the same goal? Also, I tried just taking the stream a BufferedInputStream but it tells me that I am resetting to an invalid mark; however, it does support the mark/reset methods. Could that still be a problem with inputstream not supporting mark/reset?
Thank you,
Ellie
setaret2004@yahoo.com

http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html#markSupported()

Edited by: setaret2004 on Sep 12, 2008 11:31 AM

Edited by: setaret2004 on Sep 12, 2008 11:53 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2008
Added on Sep 12 2008
3 comments
4,361 views