8227080: (fs) Files.newInputStream(...).skip(n) is slow

Brian Burkhalter brian.burkhalter at oracle.com
Wed Jul 3 15:08:51 UTC 2019


> On Jul 3, 2019, at 7:58 AM, Florian Weimer <fweimer at redhat.com> wrote:
> 
>> Doesn't this need a fallback in case the seek operation fails?  I think
>> you can have FileChannels which are not seekable in practice, e.g. if
>> the file is actually a FIFO.
>> 
>> Would that not violate the SeekableByteChannel specification?
> 
> I suppose it does, but what can FileChannel do if not all files in the
> file system are seekable, in the sense that opening them does not give
> you a seekable file descriptor?

The behavior would be the same as it is now. This change only addresses the case where the instance variable ch is a SeekableByteChannel.

Thanks,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190703/3a433258/attachment.html>


More information about the nio-dev mailing list