Shouldn't ObjectInputStream extend FilterInputStream?
- by Vaibhav Bajpai
The block quotes are from the Java Docs -
A FilterInputStream contains some
other input stream, which it uses as
its basic source of data, possibly
transforming the data along the way or
providing additional functionality.
A DataInputStream lets an
application read primitive Java data
types from an underlying input stream
in a machine-independent way.
The DataInputStream therefore extends FilterInputStream
An ObjectInputStream deserializes
primitive data and objects previously
written using an ObjectOutputStream.
However, for some reason the ObjectInputStream does NOT extend FilterInputStream even though it is also reading objects (this time and not primitive types) from the underlying input stream. Here is the branching of the concerned classes.
Is there is a design reasoning for the same?