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

Alan Bateman Alan.Bateman at oracle.com
Tue Jul 9 09:19:18 UTC 2019


On 03/07/2019 22:49, Brian Burkhalter wrote:
>
> I went ahead and checked in the .01 version of the patch. If there is 
> a need to make available() synchronized then this can be addressed 
> under a different issue.
I wasn't around for the review but one thing that needs to be 
re-examined is skipping beyond EOF as that is okay to do with files. 
FileInputStream.skip has a paragraph on this case, as does 
FileChannel.position, so probably best if the InputStream returned by 
Files.newInputStream is consistent.

A minor nit but I don't think Files/Misc.java is the right place to add 
the test. Instead I think we should add a more comprehensive 
InputStreamTest that exercises all of the input stream methods.

-Alan


More information about the nio-dev mailing list