FilterOutputStream the most useless class in the JDK?

I fell into the exact same trap as Riven did url=http://www.java-gaming.org/index.php/topic,22574.0[/url].

What is the point of this class existing if the default method implementations are so stupid :confused:

FilterInputStream is similarly flawed in that read(byte[]) invokes read(byte[],offset,len), resulting in it invoking your subclass implementation potentially causing unintended behaviour.
There’s a hint in the javadoc that this flawed behaviour is to compensate for a stupid implementation in FilterInputStream’s known subclasses:

These Filter classes should be such trivial wrapper implementations it boggles my mind how they ended up having such convoluted & downright broken behaviour.

They should both be deprecated, and flagged with a big “DO NOT USE THESE CLASSES, THEY’RE FUNCTIONALLY USELESS/BROKEN” warning.