Does java FileChannnel.transferTo() work cleverly when files are on network?
http://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileChannel.html
says
Bytes can be transferred from a file to some other channel, and vice versa, in a way that can be optimized by many operating systems into a very fast transfer directly to or from the filesystem cache.
If both files are locally on the computer I can understand how this works.
But if the files are on the same network drive does the same apply or not ?
What I mean by this is do the bytes in file2 have to be transferred to local computer first in order to be written to the second file, on a slow network connection this would seem to outweigh any advantages of bypassing the Java heap. Or can the OS say ' Transfer x bytes from file 1 to file 2 and because they are on same drive the actual bytes dont have to be transferred over the network just the instruction to do the transfer'
链接地址: http://www.djcxy.com/p/64088.html上一篇: 如何使用SSH从服务器下载文件?