Język

FileChannel.TransferToAsync(Int64, Int64, IWritableByteChannel) Method

Definition

Runs a synchronous transfer from this file to the target channel in a task without changing this channel's current file position.

public System.Threading.Tasks.Task<long> TransferToAsync(long position, long count, Java.Nio.Channels.IWritableByteChannel? target);
member this.TransferToAsync : int64 * int64 * Java.Nio.Channels.IWritableByteChannel -> System.Threading.Tasks.Task<int64>

Parameters

position
Int64

The non-negative byte offset in this file at which to start reading. No bytes are transferred if this offset exceeds the current file size.

count
Int64

The maximum number of bytes to transfer. Must be non-negative.

target
IWritableByteChannel

The channel to which bytes are written. If it has a position, that position advances by the number of bytes written.

Returns

A task whose result is the number of bytes transferred, possibly zero and possibly less than count.

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