I just found that FilterInputStream(InputStream) has a different access modifier(protected
) to that(public
) of FilterOutputStream(OutputStream)
Is there any technical reason for this?
That's a good spot. The designers made a few mistakes when defining the Java API, and this inconsistency seems to be one of them. There's no reason why you would want to instantiate a FilterOutputStream directly, so defining the constructor with protected visibility should be preferred.
Another question you might ask is why are these classes not abstract. There's no technical reason for it being this way, it's just how it was designed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With