Channel which 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.
FileRegion might fail or yield worse
performance. For example, sending a large file doesn't work well in Windows.
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public long | |
| public FileRegion | |
| public FileRegion | retain(int increment)
Redeclares io. increment.
|
| public FileRegion | touch()
Redeclares io. |
| public FileRegion | touch(Object hint)
Redeclares io. |
| public long | |
| public long | |
| public long | transferTo(WritableByteChannel
the destination of the transfer target, long the relative offset of the file where the transfer
begins from. For example, 0 will make the
transfer start from position)position()th byte and
count() - 1 will make the last
byte of the region transferred.Transfers the content of this file region to the specified channel. |
| count | back to summary |
|---|---|
| public long count() Returns the number of bytes to transfer. | |
| position | back to summary |
|---|---|
| public long position() Returns the offset in the file where the transfer began. | |
| retain | back to summary |
|---|---|
| public FileRegion retain() Redeclares io. Doc from io. Increases the reference count by
| |
| retain | back to summary |
|---|---|
| public FileRegion retain(int increment) Redeclares io. Doc from io. Increases the reference count by the specified
| |
| touch | back to summary |
|---|---|
| public FileRegion touch() Redeclares io. Doc from io. Records the current access location of this object for debugging purposes.
If this object is determined to be leaked, the information recorded by this operation will be provided to you
via
| |
| touch | back to summary |
|---|---|
| public FileRegion touch(Object hint) Redeclares io. Doc from io. Records the current access location of this object with an additional arbitrary information for debugging
purposes. If this object is determined to be leaked, the information recorded by this operation will be
provided to you via
| |
| transfered | back to summary |
|---|---|
| public long transfered()
Deprecated Use Returns the bytes which was transferred already.
| |
| transferred | back to summary |
|---|---|
| public long transferred() Returns the bytes which was transferred already. | |
| transferTo | back to summary |
|---|---|
| public long transferTo(WritableByteChannel target, long position) throws IOException Transfers the content of this file region to the specified channel.
| |