RFR: 8233451: (fs) Files.newInputStream() cannot be used with character special files [v2]

Alan Bateman alanb at openjdk.org
Fri Oct 18 08:09:57 UTC 2024


On Thu, 17 Oct 2024 22:56:33 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> test/jdk/java/nio/file/Files/InputStreamTest.java line 139:
>> 
>>> 137:             InputStream s = Files.newInputStream(stdin);
>>> 138:             s.available();
>>> 139:         }
>> 
>> I assume you meant to close the input stream.
>> 
>> What about the other methods defined by InputStream that have special handling in ChannelInputStream? I assume we should add test coverage for these methods.
>
> I added test coverage for `skip` but not for `readAllBytes` nor `readNBytes`:
> - `readAllBytes` throws before but hangs after the change;
> - `readNBytes` hangs both before and after the change.

I wonder if there is another special file that could be read to EOF to allow the methods be tested. Asking because the overrides have a code path we need to test.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21508#discussion_r1806067813


More information about the nio-dev mailing list