- buffer
- the buffer containing the bytes to be written.
- position
- the (non-negative) position at which to write the bytes.
Documentation for this section has not yet been entered.
Type Reason Java.Lang.IllegalArgumentException if position is less than 0. Java.Nio.Channels.ClosedChannelException if this channel is closed. Java.Nio.Channels.NonWritableChannelException if the channel was not opened in write-mode. Java.Nio.Channels.AsynchronousCloseException if this channel is closed by another thread while this method is executing. Java.Nio.Channels.ClosedByInterruptException if another thread interrupts the calling thread while this operation is in progress. The interrupt state of the calling thread is set and the channel is closed. Java.IO.IOException if another I/O error occurs.
Writes bytes from the given buffer to this file channel starting at the given file position.
The bytes are written starting at the given file position (up to the remaining number of bytes in the buffer). The number of bytes actually written is returned.
If the position is beyond the current end of file, then the file is first extended up to the given position by the required number of unspecified byte values.
Note that the file position is not modified by this method.