Skip to content

Commit

Permalink
6924219: (fc spec) FileChannel.write(ByteBuffer, position) behavior w…
Browse files Browse the repository at this point in the history
…hen file opened for append not specified

Reviewed-by: alanb
  • Loading branch information
Brian Burkhalter committed Oct 18, 2022
1 parent 5dbd495 commit d1f7945
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/java.base/share/classes/java/nio/channels/FileChannel.java
Expand Up @@ -146,7 +146,9 @@
* operation 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.
* therefore unspecified. In this mode the behavior of the method to
* {@linkplain #write(ByteBuffer,long) write at a given position} is also
* system-dependent.
*
* @see java.io.FileInputStream#getChannel()
* @see java.io.FileOutputStream#getChannel()
Expand Down Expand Up @@ -193,7 +195,9 @@ protected FileChannel() { }
* 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
* therefore unspecified. The effect of {@linkplain
* #write(ByteBuffer,long) writing at a given position} with this option
* present is unspecified. This option may not be used in conjunction
* with the {@code READ} or {@code TRUNCATE_EXISTING} options. </td>
* </tr>
* <tr>
Expand Down Expand Up @@ -809,6 +813,9 @@ public abstract long transferFrom(ReadableByteChannel src,
* grown to accommodate the new bytes; the values of any bytes between the
* previous end-of-file and the newly-written bytes are unspecified. </p>
*
* <p> If the file is open in <a href="#append-mode">append mode</a>, then
* the effect of invoking this method is unspecified.
*
* @param src
* The buffer from which bytes are to be transferred
*
Expand Down

0 comments on commit d1f7945

Please sign in to comment.