RFR: 8294375: test/jdk/java/nio/channels/vthread/BlockingChannelOps.java is slow

Alan Bateman alanb at openjdk.org
Tue Sep 27 13:59:29 UTC 2022


On Tue, 27 Sep 2022 13:55:14 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> test/jdk/java/net/vthread/BlockingSocketOps.java line 714:
>> 
>>> 712:     }
>>> 713: 
>>> 714:     static void readToEOF(InputStream in) throws IOException {
>> 
>> just curious: isn't that just `in.readAllBytes()`?
>> Oh - I see. You don't want to accumulate all the bytes. 
>> An alternative would be `in.transferTo(OutputStream.nullOutputStream())`
>
> Or perhaps `InputStream.skip(MAX_INT)`.

Yes, this would work too. We just need something to read the input stream to EOF so that the connection peer reads -1/EOF.

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

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


More information about the nio-dev mailing list