01: package org.apache.mina.common;
02:
03: import java.nio.channels.FileChannel;
04:
05: /**
06: * Indicates the region of a file to be sent to the remote host.
07: *
08: * @author The Apache MINA Project (dev@mina.apache.org)
09: * @version $Rev: 560320 $, $Date: 2007-07-27 11:12:26 -0600 (Fri, 27 Jul 2007) $,
10: */
11: public interface FileRegion {
12:
13: /**
14: * The open <tt>FileChannel<tt> from which data will be read to send to remote host.
15: *
16: * @return An open <tt>FileChannel<tt>.
17: */
18: FileChannel getFileChannel();
19:
20: /**
21: * The current file position from which data will be read.
22: *
23: * @return The current file position.
24: */
25: long getPosition();
26:
27: /**
28: * Updates the current file position. May not be negative.
29: *
30: * @param value The new value for the file position.
31: */
32: void setPosition(long value);
33:
34: /**
35: * The number of bytes to be written from the file to the remote host.
36: *
37: * @return The number of bytes to be written.
38: */
39: long getCount();
40:
41: /**
42: * The total number of bytes already written.
43: *
44: * @return The total number of bytes already written.
45: */
46: long getWrittenBytes();
47:
48: }
|