equal
deleted
inserted
replaced
37 import java.util.Collections; |
37 import java.util.Collections; |
38 |
38 |
39 /** |
39 /** |
40 * A channel for reading, writing, mapping, and manipulating a file. |
40 * A channel for reading, writing, mapping, and manipulating a file. |
41 * |
41 * |
42 * <p> {@note revised} |
42 * <p> A file channel is a {@link SeekableByteChannel} that is connected to |
43 * A file channel is a {@link SeekableByteChannel} that is connected to |
|
44 * a file. It has a current <i>position</i> within its file which can |
43 * a file. It has a current <i>position</i> within its file which can |
45 * be both {@link #position() <i>queried</i>} and {@link #position(long) |
44 * be both {@link #position() <i>queried</i>} and {@link #position(long) |
46 * <i>modified</i>}. The file itself contains a variable-length sequence |
45 * <i>modified</i>}. The file itself contains a variable-length sequence |
47 * of bytes that can be read and written and whose current {@link #size |
46 * of bytes that can be read and written and whose current {@link #size |
48 * <i>size</i>} can be queried. The size of the file increases |
47 * <i>size</i>} can be queried. The size of the file increases |
149 * |
148 * |
150 * @author Mark Reinhold |
149 * @author Mark Reinhold |
151 * @author Mike McCloskey |
150 * @author Mike McCloskey |
152 * @author JSR-51 Expert Group |
151 * @author JSR-51 Expert Group |
153 * @since 1.4 |
152 * @since 1.4 |
154 * @updated 1.7 |
|
155 */ |
153 */ |
156 |
154 |
157 public abstract class FileChannel |
155 public abstract class FileChannel |
158 extends AbstractInterruptibleChannel |
156 extends AbstractInterruptibleChannel |
159 implements SeekableByteChannel, GatheringByteChannel, ScatteringByteChannel |
157 implements SeekableByteChannel, GatheringByteChannel, ScatteringByteChannel |
162 * Initializes a new instance of this class. |
160 * Initializes a new instance of this class. |
163 */ |
161 */ |
164 protected FileChannel() { } |
162 protected FileChannel() { } |
165 |
163 |
166 /** |
164 /** |
167 * {@note new} |
|
168 * Opens or creates a file, returning a file channel to access the file. |
165 * Opens or creates a file, returning a file channel to access the file. |
169 * |
166 * |
170 * <p> The {@code options} parameter determines how the file is opened. |
167 * <p> The {@code options} parameter determines how the file is opened. |
171 * The {@link StandardOpenOption#READ READ} and {@link StandardOpenOption#WRITE |
168 * The {@link StandardOpenOption#READ READ} and {@link StandardOpenOption#WRITE |
172 * WRITE} options determine if the file should be opened for reading and/or |
169 * WRITE} options determine if the file should be opened for reading and/or |
291 } |
288 } |
292 |
289 |
293 private static final FileAttribute<?>[] NO_ATTRIBUTES = new FileAttribute[0]; |
290 private static final FileAttribute<?>[] NO_ATTRIBUTES = new FileAttribute[0]; |
294 |
291 |
295 /** |
292 /** |
296 * {@note new} |
|
297 * Opens or creates a file, returning a file channel to access the file. |
293 * Opens or creates a file, returning a file channel to access the file. |
298 * |
294 * |
299 * <p> An invocation of this method behaves in exactly the same way as the |
295 * <p> An invocation of this method behaves in exactly the same way as the |
300 * invocation |
296 * invocation |
301 * <pre> |
297 * <pre> |