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

Alan Bateman alanb at openjdk.org
Tue Oct 15 15:21:11 UTC 2024


On Tue, 15 Oct 2024 15:03:50 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

> Albeit with my very basic understanding of these internals, it seems wrong that the `FileChannel` created to represent a special ends up also being a `SeekableFileChannel`. This seems like the true root of the problem - that is, the fact that these files are being labeled as seekable but they're not actually seekable is what leads to the bug.

FileChannel implements SeekableByteChannel. You'll see exactly the same thing if you use FileChannel.open to open a special file.

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

PR Comment: https://git.openjdk.org/jdk/pull/21508#issuecomment-2414238334


More information about the nio-dev mailing list