Lackadaisical One-to-One between Char and Byte Streams
Posted
by Vaibhav Bajpai
on Stack Overflow
See other posts from Stack Overflow
or by Vaibhav Bajpai
Published on 2010-05-25T11:40:50Z
Indexed on
2010/05/25
12:11 UTC
Read the original article
Hit count: 284
I expected to have a one-to-one correspondence between the character streams and byte streams in terms of how the classes are organized in their hierarchy.
FilterReader
and FilterWriter
(character streams) correspond back to FilterInputStream
and FilterOutputStream
(byte stream) classes.
However I noticed few changes as -
BufferedInputStream
extendsFilterInputStream
, butBufferedReader
does NOT extendFilterReader
.BufferedOutputStream
andPrintStream
both extendFilterOutputStream
, butBufferedWriter
andPrintWriter
does NOT extendFilterWriter
.FilterInputStream
andFilterOutputStream
are not abstract classes, butFilterReader
andFilterWriter
are.
I am not sure if I am being too paranoid to point out such differences, but was just curious to know if there was design reasoning behind such decision.
© Stack Overflow or respective owner