< prev index next >

src/java.base/share/classes/java/nio/channels/FileChannel.java

Print this page

        

*** 175,243 **** * options may be present: * * <table class="striped"> * <caption style="display:none">additional options</caption> * <thead> ! * <tr> <th>Option</th> <th>Description</th> </tr> * </thead> * <tbody> * <tr> ! * <td> {@link StandardOpenOption#APPEND APPEND} </td> * <td> If this option is present then the file is opened for writing and * each invocation of the channel's {@code write} method first advances * the position to the end of the file and then writes the requested * data. Whether the advancement of the position and the writing of the * data are done in a single atomic operation is system-dependent and * therefore unspecified. This option may not be used in conjunction * with the {@code READ} or {@code TRUNCATE_EXISTING} options. </td> * </tr> * <tr> ! * <td> {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} </td> * <td> If this option is present then the existing file is truncated to * a size of 0 bytes. This option is ignored when the file is opened only * for reading. </td> * </tr> * <tr> ! * <td> {@link StandardOpenOption#CREATE_NEW CREATE_NEW} </td> * <td> If this option is present then a new file is created, failing if * the file already exists. When creating a file the check for the * existence of the file and the creation of the file if it does not exist * is atomic with respect to other file system operations. This option is * ignored when the file is opened only for reading. </td> * </tr> * <tr> ! * <td > {@link StandardOpenOption#CREATE CREATE} </td> * <td> If this option is present then an existing file is opened if it * exists, otherwise a new file is created. When creating a file the check * for the existence of the file and the creation of the file if it does * not exist is atomic with respect to other file system operations. This * option is ignored if the {@code CREATE_NEW} option is also present or * the file is opened only for reading. </td> * </tr> * <tr> ! * <td > {@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} </td> * <td> When this option is present then the implementation makes a * <em>best effort</em> attempt to delete the file when closed by the * the {@link #close close} method. If the {@code close} method is not * invoked then a <em>best effort</em> attempt is made to delete the file * when the Java virtual machine terminates. </td> * </tr> * <tr> ! * <td>{@link StandardOpenOption#SPARSE SPARSE} </td> * <td> When creating a new file this option is a <em>hint</em> that the * new file will be sparse. This option is ignored when not creating * a new file. </td> * </tr> * <tr> ! * <td> {@link StandardOpenOption#SYNC SYNC} </td> * <td> Requires that every update to the file's content or metadata be * written synchronously to the underlying storage device. (see <a * href="../file/package-summary.html#integrity"> Synchronized I/O file * integrity</a>). </td> * </tr> * <tr> ! * <td> {@link StandardOpenOption#DSYNC DSYNC} </td> * <td> Requires that every update to the file's content be written * synchronously to the underlying storage device. (see <a * href="../file/package-summary.html#integrity"> Synchronized I/O file * integrity</a>). </td> * </tr> --- 175,243 ---- * options may be present: * * <table class="striped"> * <caption style="display:none">additional options</caption> * <thead> ! * <tr> <th scope="col">Option</th> <th scope="col">Description</th> </tr> * </thead> * <tbody> * <tr> ! * <th scope="row"> {@link StandardOpenOption#APPEND APPEND} </th> * <td> If this option is present then the file is opened for writing and * each invocation of the channel's {@code write} method first advances * the position to the end of the file and then writes the requested * data. Whether the advancement of the position and the writing of the * data are done in a single atomic operation is system-dependent and * therefore unspecified. This option may not be used in conjunction * with the {@code READ} or {@code TRUNCATE_EXISTING} options. </td> * </tr> * <tr> ! * <th scope="row"> {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} </th> * <td> If this option is present then the existing file is truncated to * a size of 0 bytes. This option is ignored when the file is opened only * for reading. </td> * </tr> * <tr> ! * <th scope="row"> {@link StandardOpenOption#CREATE_NEW CREATE_NEW} </th> * <td> If this option is present then a new file is created, failing if * the file already exists. When creating a file the check for the * existence of the file and the creation of the file if it does not exist * is atomic with respect to other file system operations. This option is * ignored when the file is opened only for reading. </td> * </tr> * <tr> ! * <th scope="row" > {@link StandardOpenOption#CREATE CREATE} </th> * <td> If this option is present then an existing file is opened if it * exists, otherwise a new file is created. When creating a file the check * for the existence of the file and the creation of the file if it does * not exist is atomic with respect to other file system operations. This * option is ignored if the {@code CREATE_NEW} option is also present or * the file is opened only for reading. </td> * </tr> * <tr> ! * <th scope="row" > {@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} </th> * <td> When this option is present then the implementation makes a * <em>best effort</em> attempt to delete the file when closed by the * the {@link #close close} method. If the {@code close} method is not * invoked then a <em>best effort</em> attempt is made to delete the file * when the Java virtual machine terminates. </td> * </tr> * <tr> ! * <th scope="row">{@link StandardOpenOption#SPARSE SPARSE} </th> * <td> When creating a new file this option is a <em>hint</em> that the * new file will be sparse. This option is ignored when not creating * a new file. </td> * </tr> * <tr> ! * <th scope="row"> {@link StandardOpenOption#SYNC SYNC} </th> * <td> Requires that every update to the file's content or metadata be * written synchronously to the underlying storage device. (see <a * href="../file/package-summary.html#integrity"> Synchronized I/O file * integrity</a>). </td> * </tr> * <tr> ! * <th scope="row"> {@link StandardOpenOption#DSYNC DSYNC} </th> * <td> Requires that every update to the file's content be written * synchronously to the underlying storage device. (see <a * href="../file/package-summary.html#integrity"> Synchronized I/O file * integrity</a>). </td> * </tr>
< prev index next >