RFR: 8286200: SequenceInputStream::read(b, off, 0) returns -1 at EOF

Raffaello Giulietti duke at openjdk.java.net
Thu May 12 08:44:49 UTC 2022


On Wed, 11 May 2022 20:47:52 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Modify the specification of `SequenceInputStream.read(byte[],int,int)` to indicate that `-1` is returned at the EOF of the last stream even if `len` is zero.

Also, in the current implementation, when the end of the last contained stream has been reached and `-1` is returned, none of the arguments is checked, so a caller can pass `null` for `b` or out of bounds indices `off` and `len`. This is at odd with the `@throws` clauses.

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

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


More information about the core-libs-dev mailing list