On Tue, 7 Feb 2023 16:40:06 GMT, Brian Burkhalter <[email protected]> wrote:
>> `java.io.InputStream::transferTo` could conceivably return a negative value
>> if the count of bytes transferred overflows a `long`. Modify the method to
>> limit the number of bytes transferred to `Long.MAX_VALUE` per invocation.
>
> Brian Burkhalter has updated the pull request incrementally with one
> additional commit since the last revision:
>
> 8297632: Increment recent copyright year to 2023
This version looks okay.
src/java.base/share/classes/java/io/SequenceInputStream.java line 249:
> 247: } catch (ArithmeticException ignore) {
> 248: return Long.MAX_VALUE;
> 249: }
This one could check if c < Long.MAX_VALUE like the other implementations, if
only for consistency. c could be renamed to transferred too.
-------------
Marked as reviewed by alanb (Reviewer).
PR: https://git.openjdk.org/jdk/pull/11403