RFR: 8279283 - BufferedInputStream should override transferTo [v8]

Сергей Цыпанов duke at openjdk.org
Tue Sep 6 14:54:08 UTC 2022


On Tue, 6 Sep 2022 12:50:50 GMT, Markus KARG <duke at openjdk.org> wrote:

>> Implementation of JDK-8279283
>
> Markus KARG has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains ten commits:
> 
>  - proposal by Alan Bateman
>  - modified locking
>  - HexPrinter::transferTo
>  - using getBufIfOpen() instead of direct buf access
>  - fixed missing BufferedInputStream
>  - removed unused code
>  - test for BufferedInputStream.transferTo
>  - synchronized BufferedInputStream::transferTo
>  - BufferedInputStream::transferTo

src/java.base/share/classes/java/io/BufferedInputStream.java line 608:

> 606:     private long implTransferTo(OutputStream out) throws IOException {
> 607:         if (getClass() == BufferedInputStream.class
> 608:                 && ((count - pos) <= 0) && (markpos == -1)) {

Tiny thing: I think with 3 `&&`s we don't need parenthesis around `((count - pos) <= 0) && (markpos == -1))`. How about to leave leave only the one around `count - pos`?

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

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


More information about the core-libs-dev mailing list