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!

BufferedInputStream - size of buffer, mark, reset, skip - how it works?

Rafal ZApr 16 2013 — edited Apr 16 2013
Hallo,
I don't fully understand the relations of buffersize, mark and marklimit and skip of the class BufferedInptutStream. With the constructor BufferedInputStream(InputStream in, int size) I can set the size of Buffer. But what happens if I invoke the method mark(int n) where n is greater then the size of buffer used in the constructor? Does mark use own buffer, or it resizes the existing buffer?
Does skip() work without using mark(), or I have to invoke mark() before I invoke skip()? Is it possibble to skip forward beyond the given buffersize/marklimit?

With best regards

Rafal Ziolkowski
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2013
Added on Apr 16 2013
2 comments
337 views