Share via


SocketChannel.Write Method

Definition

Overloads

Write(ByteBuffer[])

Writes bytes from all the given byte buffers to this socket channel.

Write(ByteBuffer)

Writes bytes from the given byte buffer to this socket channel.

Write(ByteBuffer[], Int32, Int32)

Attempts to write a subset of the given bytes from the buffers to this socket channel.

Write(ByteBuffer[])

Writes bytes from all the given byte buffers to this socket channel.

[Android.Runtime.Register("write", "([Ljava/nio/ByteBuffer;)J", "")]
public long Write (Java.Nio.ByteBuffer[]? srcs);
[<Android.Runtime.Register("write", "([Ljava/nio/ByteBuffer;)J", "")>]
abstract member Write : Java.Nio.ByteBuffer[] -> int64
override this.Write : Java.Nio.ByteBuffer[] -> int64

Parameters

srcs
ByteBuffer[]

Returns

Implements

Attributes

Exceptions

if this channel is closed by another thread during this write operation.

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.

if this channel is closed.

if another I/O error occurs.

if this channel is not yet connected.

Remarks

Java documentation for java.nio.channels.SocketChannel.write(java.nio.ByteBuffer[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to

Write(ByteBuffer)

Writes bytes from the given byte buffer to this socket channel.

[Android.Runtime.Register("write", "(Ljava/nio/ByteBuffer;)I", "GetWrite_Ljava_nio_ByteBuffer_Handler")]
public abstract int Write (Java.Nio.ByteBuffer? src);
[<Android.Runtime.Register("write", "(Ljava/nio/ByteBuffer;)I", "GetWrite_Ljava_nio_ByteBuffer_Handler")>]
abstract member Write : Java.Nio.ByteBuffer -> int

Parameters

Returns

Implements

Attributes

Exceptions

if another thread closes the channel during the write.

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.

if the channel was already closed.

if another I/O error occurs.

if this channel is not connected yet.

Remarks

Java documentation for java.nio.channels.SocketChannel.write(java.nio.ByteBuffer).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to

Write(ByteBuffer[], Int32, Int32)

Attempts to write a subset of the given bytes from the buffers to this socket channel.

[Android.Runtime.Register("write", "([Ljava/nio/ByteBuffer;II)J", "GetWrite_arrayLjava_nio_ByteBuffer_IIHandler")]
public abstract long Write (Java.Nio.ByteBuffer[]? srcs, int offset, int length);
[<Android.Runtime.Register("write", "([Ljava/nio/ByteBuffer;II)J", "GetWrite_arrayLjava_nio_ByteBuffer_IIHandler")>]
abstract member Write : Java.Nio.ByteBuffer[] * int * int -> int64

Parameters

srcs
ByteBuffer[]
offset
Int32

the index of the first buffer in buffers to get bytes from.

length
Int32

the number of buffers to get bytes from.

Returns

Implements

Attributes

Exceptions

if this channel is closed by another thread during this write operation.

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.

if this channel is closed.

if offset or length , or if offset + length is greater than the size of sources.

if another I/O error occurs.

if this channel is not yet connected.

Remarks

Java documentation for java.nio.channels.SocketChannel.write(java.nio.ByteBuffer[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

  • <xref:Java.Nio.Channels.IGatheringByteChannel.Write(Java.Nio.ByteBuffer%5b%5d%2c+System.Int32%2c+System.Int32)>

Applies to