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: 341
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 -
BufferedInputStreamextendsFilterInputStream, butBufferedReaderdoes NOT extendFilterReader.BufferedOutputStreamandPrintStreamboth extendFilterOutputStream, butBufferedWriterandPrintWriterdoes NOT extendFilterWriter.FilterInputStreamandFilterOutputStreamare not abstract classes, butFilterReaderandFilterWriterare.
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