public class DefaultFileRegion extends Object implements FileRegion
| Constructor and Description |
|---|
DefaultFileRegion(FileChannel channel) |
DefaultFileRegion(FileChannel channel,
long position,
long remainingBytes) |
| Modifier and Type | Method and Description |
|---|---|
FileChannel |
getFileChannel()
The open FileChannel from which data will be read to send to
remote host.
|
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(FileChannel channel) throws IOException
IOExceptionpublic DefaultFileRegion(FileChannel channel, long position, long remainingBytes)
public long getWrittenBytes()
FileRegiongetWrittenBytes in interface FileRegionpublic long getRemainingBytes()
FileRegiongetRemainingBytes in interface FileRegionpublic FileChannel getFileChannel()
FileRegiongetFileChannel in interface FileRegionpublic long getPosition()
FileRegiongetPosition in interface FileRegionpublic void update(long value)
FileRegionFileRegion.getPosition() and
getWrittenBytes by the given amount and decreases the value
returned by #getCount() by the given amount.update in interface FileRegionvalue - The new value for the file position.public String getFilename()
FileRegiongetFilename in interface FileRegion