Language

InputStream.ReadAsync Method

Definition

Overloads

Name Description
ReadAsync()

Reads one byte from this stream in a task.

ReadAsync(Byte[])

Reads bytes into a buffer in a task.

ReadAsync(Byte[], Int32, Int32)

Reads bytes into a buffer range in a task.

ReadAsync()

Reads one byte from this stream in a task.

public System.Threading.Tasks.Task<int> ReadAsync();
member this.ReadAsync : unit -> System.Threading.Tasks.Task<int>

Returns

A task whose result is the next byte as an integer, or -1 at the end of the stream.

Remarks

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.

Applies to

ReadAsync(Byte[])

Reads bytes into a buffer in a task.

public System.Threading.Tasks.Task<int> ReadAsync(byte[]? b);
member this.ReadAsync : byte[] -> System.Threading.Tasks.Task<int>

Parameters

b
Byte[]

The buffer that receives bytes read from this stream.

Returns

A task whose result is 0 for an empty buffer; otherwise, the number of bytes read, or -1 if the stream ends before a byte is read.

Remarks

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.

Applies to

ReadAsync(Byte[], Int32, Int32)

Reads bytes into a buffer range in a task.

public System.Threading.Tasks.Task<int> ReadAsync(byte[]? b, int off, int len);
member this.ReadAsync : byte[] * int * int -> System.Threading.Tasks.Task<int>

Parameters

b
Byte[]

The buffer that receives the bytes read.

off
Int32

The buffer index at which received bytes are stored.

len
Int32

The maximum number of bytes to read.

Returns

A task whose result is 0 when len is 0; otherwise, the number of bytes read, or -1 if the stream ends before a byte is read.

Remarks

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.

Applies to