pictorial representation -
InputStream ---> FileInputStream
|
|
---> FilterInputStream ---> BufferedInputStream
But then the Reader abstract class has FilterReader as a direct subclass but FileReader is not a direct subclass, FileReader extends InputStreamReader, and BufferedReader is a direct subclass of Reader and not of FilterReader, again why this decision is taken.
pictorial representation of this as well
Reader ---> InputStreamReader ---> FileReader
|
---> FilterReader
|
---> BufferedReader
Let me summarize all my queries in bullet pointers for easy answering -
* Why BufferedReader is a direct subclass of Reader and not extend FilterReader, as in the InputStream hierarchy.
* Why does FileReader extend InputStreamReader and not directly a subclass of Reader ?
* What capabilities were given to InputStreamReader because of which FileReader was kept a subclass of it?
* Why are those capabilities of InputStreamReader not given to FilterReader? If it was done that way, maybe the Reader abstract class might have the same hierarchy as InputStream.
* FilterReader might have been designed such that InputStreamReader can extend it and then provide an extra specialised wrapper on Reader for input-stream-specific purposes, which then can be further utilized. Why keep it a direct subclass instead?
0 comments:
Post a Comment
Thanks