Two small fixes

Alan Bateman Alan.Bateman at oracle.com
Sat Aug 21 08:17:11 PDT 2010


I'd like to get fixes for two small fixes into b108.

The first is 6431344 where FileChannel's transferTo falls back to mmap 
when sendfile/equivalent can't be used and the target is a "trusted 
channel". The implementation attempts to mmap the entire region to be 
transferred which is problematic for large transfers, esp. 32-bit where 
the address space may not be available. Same issue with transferFrom 
where mmap is used when the source is also a FileChannel. The proposed 
change just maps the file in chunks, up to 8MB at a time. I don't 
propose to include a regression test as the code is well exercised by 
existing tests, and also tests that transfer several GBs take too long 
for the regression test suite. The webrev is here:
    http://cr.openjdk.java.net/~alanb/6431344/webrev

The other one is 6978511, an oversight in the implementation to 
Path.toRealPath. The method should fail if the file does not exist. The 
fix is to trivially check that it does actually exist. The webrev is here:
   http://cr.openjdk.java.net/~alanb/6978511/webrev/

Thanks,
Alan.


More information about the nio-dev mailing list