Package org.apache.mina.core.file
Interface FileRegion
-
- All Known Implementing Classes:
DefaultFileRegion,FilenameFileRegion
public interface FileRegionIndicates the region of a file to be sent to the remote host.- Author:
- Apache MINA Project
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FileChannelgetFileChannel()The openFileChannelfrom which data will be read to send to remote host.StringgetFilename()Provides an absolute filename for the underlying FileChannel.longgetPosition()The current file position from which data will be read.longgetRemainingBytes()The number of bytes remaining to be written from the file to the remote host.longgetWrittenBytes()The total number of bytes already written.voidupdate(long amount)Updates the current file position based on the specified amount.
-
-
-
Method Detail
-
getFileChannel
FileChannel getFileChannel()
The openFileChannelfrom which data will be read to send to remote host.- Returns:
- An open
FileChannel.
-
getPosition
long getPosition()
The current file position from which data will be read.- Returns:
- The current file position.
-
update
void update(long amount)
Updates the current file position based on the specified amount. This increases the value returned bygetPosition()andgetWrittenBytes()by the given amount and decreases the value returned bygetRemainingBytes()by the givenamount.- Parameters:
amount- The new value for the file position.
-
getRemainingBytes
long getRemainingBytes()
The number of bytes remaining to be written from the file to the remote host.- Returns:
- The number of bytes remaining to be written.
-
getWrittenBytes
long getWrittenBytes()
The total number of bytes already written.- Returns:
- The total number of bytes already written.
-
getFilename
String getFilename()
Provides an absolute filename for the underlying FileChannel.- Returns:
- the absolute filename, or
nullif the FileRegion does not know the filename
-
-