RFR: JDK-8297298 - SequenceInputStream should override transferTo [v2]

Markus KARG duke at openjdk.org
Sun Nov 20 09:41:47 UTC 2022


> Since JDK 18 some implementations of InputStream.transferTo, namely FileInputStream and ChannelInputStream, offload work to lower layers using NIO channels. This provides shorter execution time and reduced resource consumption. Unfortunately, this effect is prevented once the input stream itself is wrapped by a SequenceInputStream. While compared to other InputStreams the SequenceInputStream is a rather edge case (e. g. used to merge two files into one), nevertheless it makes sense to get rid of this obstacle simply by implementing transferTo (e. g. by allowing to offload the file merge, or parts of the file merge, to the operating system). As a result, more existing applications will experience the offloading-improvements made by JDK 18.
> 
> To provide enhanced performance to existing applications, it makes sense to address this impediment: SequenceInputStream.transferTo should be implemented in a way that iteratively calls transferTo on each enumerated InputStream of the SequenceInputStream in ordered sequence.

Markus KARG has updated the pull request incrementally with one additional commit since the last revision:

  fixed bug number

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/11248/files
  - new: https://git.openjdk.org/jdk/pull/11248/files/7d63db24..22d99ba0

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=11248&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=11248&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/11248.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11248/head:pull/11248

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


More information about the core-libs-dev mailing list