RFR: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE [v5]

Brian Burkhalter bpb at openjdk.org
Thu Dec 8 19:40:01 UTC 2022


> `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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:

 - 8297632: Propagate change to SequenceInputStream
 - Merge
 - 8297632: Add verbiage to ZipInputStream::transferTo
 - 8297632: Add Reader::transferTo and select InputStream::transferTo overrides
 - 8297632: Transfer all bytes but clamp returned value to Long.MAX_VALUE
 - 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/11403/files
  - new: https://git.openjdk.org/jdk/pull/11403/files/558cbc8a..446771db

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=11403&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=11403&range=03-04

  Stats: 92528 lines in 1565 files changed: 46561 ins; 36948 del; 9019 mod
  Patch: https://git.openjdk.org/jdk/pull/11403.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11403/head:pull/11403

PR: https://git.openjdk.org/jdk/pull/11403


More information about the core-libs-dev mailing list