public class DefaultFileRegion extends java.lang.Object implements FileRegion
| 构造器和说明 |
|---|
DefaultFileRegion(java.nio.channels.FileChannel channel) |
DefaultFileRegion(java.nio.channels.FileChannel channel,
long position,
long remainingBytes) |
| 限定符和类型 | 方法和说明 |
|---|---|
java.nio.channels.FileChannel |
getFileChannel()
The open FileChannel from which data will be read to send to
remote host.
|
java.lang.String |
getFilename()
Provides an absolute filename for the underlying FileChannel.
|
long |
getPosition()
The current file position from which data will be read.
|
long |
getRemainingBytes()
The number of bytes remaining to be written from the file to the remote
host.
|
long |
getWrittenBytes()
The total number of bytes already written.
|
void |
update(long value)
Updates the current file position based on the specified amount.
|
public DefaultFileRegion(java.nio.channels.FileChannel channel)
throws java.io.IOException
java.io.IOExceptionpublic DefaultFileRegion(java.nio.channels.FileChannel channel,
long position,
long remainingBytes)
public long getWrittenBytes()
FileRegiongetWrittenBytes 在接口中 FileRegionpublic long getRemainingBytes()
FileRegiongetRemainingBytes 在接口中 FileRegionpublic java.nio.channels.FileChannel getFileChannel()
FileRegiongetFileChannel 在接口中 FileRegionpublic long getPosition()
FileRegiongetPosition 在接口中 FileRegionpublic void update(long value)
FileRegionFileRegion.getPosition() and
FileRegion.getWrittenBytes() by the given amount and decreases the value
returned by FileRegion.getRemainingBytes() by the given amount.update 在接口中 FileRegionvalue - The new value for the file position.public java.lang.String getFilename()
FileRegiongetFilename 在接口中 FileRegion