RFR: 8255878: FilterInputStream is missing implementations of Java 9 InputStream methods [v2]

Alan Bateman alanb at openjdk.java.net
Sat Sep 4 07:05:47 UTC 2021


On Sat, 4 Sep 2021 00:39:19 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

> This may potentially break any existing subclasses that assume that they only need to override the three
> `int read()` and `int read(byte[], int, it)` and `int skip(int)` methods - because overriding only these three methods will now no longer be sufficient.

Can you explain this a bit further? InputStream has one abstract method so that's the minimum that has to be implemented. It has base implementations of readAllBytes and readNBytes that would be very inefficient if the 3-arg read is not overridden but I wouldn't expect a correctness issue.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5367


More information about the core-libs-dev mailing list