On Sat, 4 Sep 2021 07:02:32 GMT, Alan Bateman <al...@openjdk.org> wrote:

> 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.

readAllBytes/readNBytes no longer call any variant of `this.read` - so any 
subclass that implement the two `read` methods to do something more than what 
`in.read` does might fail in unexpected ways if `readAllBytes` or `readNBytes` 
are called. I'm especially concerned with subclasses like e.g. 
`KeepAliveStream` / `MetteredStream` in `sun.net.www.http`

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

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

Reply via email to