Java.Nio.Channels.SocketChannel.Read Method
Reads bytes from this socket channel and stores them in the specified array of buffers.

Syntax

[Android.Runtime.Register("read", "([Ljava/nio/ByteBuffer;)J", "")]
public long Read (Java.Nio.ByteBuffer[] targets)

Parameters

targets
the array of byte buffers into which the bytes will be copied.

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 read 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.IO.IOExceptionif another I/O error occurs.
Java.Nio.Channels.NotYetConnectedExceptionif this channel is not yet connected.

Remarks

Reads bytes from this socket channel and stores them in the specified array of buffers. This method attempts to read as many bytes as can be stored in the buffer array from this channel and returns the number of bytes actually read.

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

Calling this method is equivalent to calling read(targets, 0, targets.length);

[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