SocketChannel.Read Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Read(ByteBuffer[], Int32, Int32) |
Reads bytes from this socket channel into a subset of the given buffers. |
Read(ByteBuffer) |
Reads bytes from this socket channel into the given buffer. |
Read(ByteBuffer[]) |
Reads bytes from this socket channel and stores them in the specified array of buffers. |
Read(ByteBuffer[], Int32, Int32)
Reads bytes from this socket channel into a subset of the given buffers.
[Android.Runtime.Register("read", "([Ljava/nio/ByteBuffer;II)J", "GetRead_arrayLjava_nio_ByteBuffer_IIHandler")]
public abstract long Read (Java.Nio.ByteBuffer[]? dsts, int offset, int length);
[<Android.Runtime.Register("read", "([Ljava/nio/ByteBuffer;II)J", "GetRead_arrayLjava_nio_ByteBuffer_IIHandler")>]
abstract member Read : Java.Nio.ByteBuffer[] * int * int -> int64
Parameters
- dsts
- ByteBuffer[]
- offset
- Int32
the index of the first buffer to store bytes in.
- length
- Int32
the maximum number of buffers to store bytes in.
Returns
Implements
- Attributes
Exceptions
if this channel is closed by another thread during this read 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 targets
.
if another I/O error occurs.
if this channel is not yet connected.
Remarks
Java documentation for java.nio.channels.SocketChannel.read(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.IScatteringByteChannel.Read(Java.Nio.ByteBuffer%5b%5d%2c+System.Int32%2c+System.Int32)>
Applies to
Read(ByteBuffer)
Reads bytes from this socket channel into the given buffer.
[Android.Runtime.Register("read", "(Ljava/nio/ByteBuffer;)I", "GetRead_Ljava_nio_ByteBuffer_Handler")]
public abstract int Read (Java.Nio.ByteBuffer? dst);
[<Android.Runtime.Register("read", "(Ljava/nio/ByteBuffer;)I", "GetRead_Ljava_nio_ByteBuffer_Handler")>]
abstract member Read : Java.Nio.ByteBuffer -> int
Parameters
- dst
- ByteBuffer
Returns
Implements
- Attributes
Exceptions
if another thread closes the channel during the read.
if this channel is not yet connected.
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.
Remarks
Java documentation for java.nio.channels.SocketChannel.read(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
Read(ByteBuffer[])
Reads bytes from this socket channel and stores them in the specified array of buffers.
[Android.Runtime.Register("read", "([Ljava/nio/ByteBuffer;)J", "")]
public long Read (Java.Nio.ByteBuffer[]? dsts);
[<Android.Runtime.Register("read", "([Ljava/nio/ByteBuffer;)J", "")>]
abstract member Read : Java.Nio.ByteBuffer[] -> int64
override this.Read : Java.Nio.ByteBuffer[] -> int64
Parameters
- dsts
- ByteBuffer[]
Returns
Implements
- Attributes
Exceptions
if this channel is closed by another thread during this read 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.read(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.