Java.Nio.Channels.IWritableByteChannel.Write Method
Writes bytes from the given buffer to the channel.

Syntax

[Android.Runtime.Register("write", "(Ljava/nio/ByteBuffer;)I", "GetWrite_Ljava_nio_ByteBuffer_Handler:Java.Nio.Channels.IWritableByteChannelInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public int Write (Java.Nio.ByteBuffer buffer)

Parameters

buffer
the byte buffer containing the bytes to be written.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Nio.Channels.NonWritableChannelExceptionif the channel was not opened for writing.
Java.Nio.Channels.ClosedChannelExceptionif the channel was already closed.
Java.Nio.Channels.AsynchronousCloseExceptionif another thread closes the channel during the write.
Java.Nio.Channels.ClosedByInterruptExceptionif another thread interrupt the calling thread during the write.
Java.IO.IOExceptionanother IO exception occurs, details are in the message.

Remarks

Writes bytes from the given buffer to the channel.

The maximum number of bytes that will be written is the remaining() number of bytes in the buffer when the method invoked. The bytes will be written from the buffer starting at the buffer's position.

The call may block if other threads are also attempting to write on the same channel.

Upon completion, the buffer's position() is updated to the end of the bytes that were written. The buffer's limit() is unmodified.

[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