RFR: 8341666: FileInputStream doesn't support readAllBytes() or readNBytes(int) on pseudo devices [v4]

Alan Bateman alanb at openjdk.org
Fri Oct 25 18:12:15 UTC 2024


On Fri, 25 Oct 2024 17:04:22 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Modify `FileInputStream` (FIS) to fall back to the superclass implementations of `readAllBytes()`, `readNBytes(int)`, `skip()`, and `transferTo` when the input source would otherwise fail with "Illegal Seek" in the FIS implementation, such as for the standard input or a named pipe.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8341666: Fix Windows oversight

Marked as reviewed by alanb (Reviewer).

src/java.base/share/classes/java/io/FileInputStream.java line 86:

> 84: 
> 85:     // This field indicates whether the position0() or skip0() may be
> 86:     // invoked without encountering an illegal seek exception.

You might be update this to say that it indicates if the file is regular file as some operations need the current position and to seek. Otherwise the src changes looks good.

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

PR Review: https://git.openjdk.org/jdk/pull/21673#pullrequestreview-2396103849
PR Review Comment: https://git.openjdk.org/jdk/pull/21673#discussion_r1817161513


More information about the core-libs-dev mailing list