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.