Język

FileChannel.ReadAsync Method

Definition

Overloads

Name Description
ReadAsync(ByteBuffer, Int64)

Runs a synchronous read in a task at the specified file offset without changing this channel's current file position.

ReadAsync(ByteBuffer[], Int32, Int32)

Runs a synchronous scattering read into the selected buffers in a task, advancing this channel's file position by the number of bytes read.

ReadAsync(ByteBuffer)

Runs a synchronous read in a task, starting at this channel's current file position and advancing that position by the number of bytes read.

ReadAsync(ByteBuffer[])

Runs a synchronous scattering read into all supplied buffers in a task, advancing this channel's file position by the number of bytes read.

ReadAsync(ByteBuffer, Int64)

Runs a synchronous read in a task at the specified file offset without changing this channel's current file position.

public System.Threading.Tasks.Task<int> ReadAsync(Java.Nio.ByteBuffer? dst, long position);
member this.ReadAsync : Java.Nio.ByteBuffer * int64 -> System.Threading.Tasks.Task<int>

Parameters

dst
ByteBuffer

The destination buffer. Its position advances by the number of bytes read; its limit is unchanged.

position
Int64

The non-negative byte offset in the file at which to start reading.

Returns

A task whose result is the number of bytes read, possibly zero, or -1 if the specified offset is at or beyond the end of the file. The read need not fill the buffer.

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(ByteBuffer[], Int32, Int32)

Runs a synchronous scattering read into the selected buffers in a task, advancing this channel's file position by the number of bytes read.

public System.Threading.Tasks.Task<long> ReadAsync(Java.Nio.ByteBuffer[]? dsts, int offset, int length);
member this.ReadAsync : Java.Nio.ByteBuffer[] * int * int -> System.Threading.Tasks.Task<int64>

Parameters

dsts
ByteBuffer[]

The destination buffer array. Selected buffers are filled in array order, advancing their positions without changing their limits.

offset
Int32

The index of the first destination buffer, from zero through the array length.

length
Int32

The number of destination buffers to use, from zero through the array length minus offset.

Returns

A task whose result is the total number of bytes read, possibly zero, or -1 at the end of the file. The read need not fill all selected buffers.

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(ByteBuffer)

Runs a synchronous read in a task, starting at this channel's current file position and advancing that position by the number of bytes read.

public System.Threading.Tasks.Task<int> ReadAsync(Java.Nio.ByteBuffer? dst);
member this.ReadAsync : Java.Nio.ByteBuffer -> System.Threading.Tasks.Task<int>

Parameters

dst
ByteBuffer

The destination buffer. Its position advances by the number of bytes read; its limit is unchanged.

Returns

A task whose result is the number of bytes read, possibly zero, or -1 at the end of the file. The read need not fill the buffer.

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(ByteBuffer[])

Runs a synchronous scattering read into all supplied buffers in a task, advancing this channel's file position by the number of bytes read.

public System.Threading.Tasks.Task<long> ReadAsync(Java.Nio.ByteBuffer[]? dsts);
member this.ReadAsync : Java.Nio.ByteBuffer[] -> System.Threading.Tasks.Task<int64>

Parameters

dsts
ByteBuffer[]

The destination buffers in array order. Each buffer's position advances by the bytes placed in it; buffer limits are unchanged.

Returns

A task whose result is the total number of bytes read, possibly zero, or -1 at the end of the file. The read need not fill all buffers.

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