Skip to Main Content

Java APIs

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!

Difference between InputStream and BufferedInputStream (is there?)

843790Apr 23 2008 — edited Apr 23 2008
Hello folks,

The documentation for BufferedInputStream states, "BufferedInputStream adds functionality to another input stream-namely, *the ability to buffer the input* and to support the mark and reset methods".

Now I understand that BufferedInputStream implements the mark() and reset() methods of InputStream...that's fine. My doubt is in the claim *"..the ability to buffer the input"* -- I dont see any difference in the various read() methods of InputStream and BufferedInputStream.... For example, even the InputStream class has the read(byte[],i,length) method which is a buffer afterall.

So my question is, where exactly is the Buffering taking place in BufferedInputStream that makes it different from InputStream.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 21 2008
Added on Apr 23 2008
1 comment
397 views