org.apache.mina.common
Class DefaultFileRegion

java.lang.Object
  extended by org.apache.mina.common.DefaultFileRegion
All Implemented Interfaces:
FileRegion

public class DefaultFileRegion
extends Object
implements FileRegion


Constructor Summary
DefaultFileRegion(FileChannel channel, long position, long count)
           
 
Method Summary
 long getCount()
          The number of bytes to be written from the file to the remote host.
 FileChannel getFileChannel()
          The open FileChannel from which data will be read to send to remote host.
 long getPosition()
          The current file position from which data will be read.
 long getWrittenBytes()
          The total number of bytes already written.
 void setPosition(long value)
          Updates the current file position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFileRegion

public DefaultFileRegion(FileChannel channel,
                         long position,
                         long count)
Method Detail

getWrittenBytes

public long getWrittenBytes()
Description copied from interface: FileRegion
The total number of bytes already written.

Specified by:
getWrittenBytes in interface FileRegion
Returns:
The total number of bytes already written.

getCount

public long getCount()
Description copied from interface: FileRegion
The number of bytes to be written from the file to the remote host.

Specified by:
getCount in interface FileRegion
Returns:
The number of bytes to be written.

getFileChannel

public FileChannel getFileChannel()
Description copied from interface: FileRegion
The open FileChannel from which data will be read to send to remote host.

Specified by:
getFileChannel in interface FileRegion
Returns:
An open FileChannel.

getPosition

public long getPosition()
Description copied from interface: FileRegion
The current file position from which data will be read.

Specified by:
getPosition in interface FileRegion
Returns:
The current file position.

setPosition

public void setPosition(long value)
Description copied from interface: FileRegion
Updates the current file position. May not be negative.

Specified by:
setPosition in interface FileRegion
Parameters:
value - The new value for the file position.


Copyright © 2004-2009 Apache MINA Project. All Rights Reserved.