Java.Nio.Channels.SocketChannel.Write Method
Writes bytes from the given byte buffer to this socket channel.

Syntax

[Android.Runtime.Register("write", "(Ljava/nio/ByteBuffer;)I", "GetWrite_Ljava_nio_ByteBuffer_Handler")]
public abstract int Write (Java.Nio.ByteBuffer source)

See Also

IWritableByteChannel.Write(Java.Nio.ByteBuffer)

Parameters

source
the byte buffer containing the bytes to be written.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Nio.Channels.AsynchronousCloseExceptionif another thread closes the channel during the write.
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 the channel was already closed.
Java.IO.IOExceptionif another I/O error occurs.
Java.Nio.Channels.NotYetConnectedExceptionif this channel is not connected yet.

Remarks

Writes bytes from the given byte buffer to this socket channel. The maximum number of bytes that are written is the remaining number of bytes in the buffer when this method is invoked. The bytes are taken from the buffer starting at the buffer's position.

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

Upon completion, the buffer's position is updated to the end of the bytes that have been written. The buffer's limit is not changed.

[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