Java.Nio.Channels.FileChannel.Write Method
Attempts to write a subset of the given bytes from the buffers to this file channel.

Syntax

[Android.Runtime.Register("write", "([Ljava/nio/ByteBuffer;II)J", "GetWrite_arrayLjava_nio_ByteBuffer_IIHandler")]
public abstract long Write (Java.Nio.ByteBuffer[] buffers, int offset, int length)

Parameters

buffers
the array of byte buffers that is the source for bytes written to this channel.
offset
the index of the first buffer in buffers to get bytes from.
length
the number of buffers to get bytes from.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Nio.Channels.AsynchronousCloseExceptionif this channel is closed by another thread during this write operation.
Java.Nio.Channels.ClosedByInterruptExceptionif 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.Nio.Channels.ClosedChannelExceptionif this channel is closed.
Java.Lang.IndexOutOfBoundsExceptionif offset or length , or if offset + length is greater than the size of buffers.
Java.IO.IOExceptionif another I/O error occurs; details are in the message.
Java.Nio.Channels.NonWritableChannelExceptionif this channel was not opened for writing.

Remarks

Attempts to write a subset of the given bytes from the buffers to this file channel. This method attempts to write all remaining() bytes from length byte buffers, in order, starting at sources[offset]. The number of bytes actually written is returned.

If a write operation is in progress, subsequent threads will block until the write is completed and then contend for the ability to write.

[Android Documentation]

Requirements

Namespace: Java.Nio.Channels
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1