The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


these danged streams...

Posted by sebastian on December 10, 2001 at 12:29 PM

after several hours of trying to figure out an error i came to the conclusion that a wrapper class to an inputStream (in this case BufferedReader) buffers a chunk of data each time you call some read method that is bigger than the chunk of data that youre reading (a character for example).
Now this gives me some trouble, because i want to read one line (with readLine()) and subsequentially start to read a file over the InputStream. But in this case a chunk of the file while be gone from the stream becuase BufferedReader read more than just one line. How can i make sure that BufferedReader (or any other convinient reader class) takes one line from the stream and not more?
Thanks in advance.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us