public interface FileRegion extends ExternalResourceReleasable
Channelwhich supports zero-copy file transfer.
FileChannel.transferTo(long, long, WritableByteChannel)has at least four known bugs in the old versions of Sun JDK and perhaps its derived ones. Please upgrade your JDK to 1.6.0_18 or later version if you are going to use zero-copy file transfer.
FileRegionmight fail or yield worse performance. For example, sending a large file doesn't work well in Windows.
FileRegion. Attempting to write a
Channelwill trigger a
ClassCastExceptionor a similar exception.
|Modifier and Type||Method and Description|
Returns the number of bytes to transfer.
Returns the offset in the file where the transfer began.
Transfers the content of this file region to the specified channel.
long transferTo(WritableByteChannel target, long position) throws IOException
Copyright © 2008-2015 The Netty Project. All Rights Reserved.