Język

FileChannel.WriteAsync Method

Definition

Overloads

Name Description
WriteAsync(ByteBuffer[])

Runs a synchronous gathering write from all supplied buffers in a task at the file position, or at the end of the file in append mode, advancing the file position by the number of bytes written.

WriteAsync(ByteBuffer)

Runs a synchronous write in a task at this channel's file position, or at the end of the file in append mode, advancing the file position by the number of bytes written.

WriteAsync(ByteBuffer, Int64)

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

WriteAsync(ByteBuffer[], Int32, Int32)

Runs a synchronous gathering write from the selected buffers in a task at the file position, or at the end of the file in append mode, advancing the file position by the number of bytes written.

WriteAsync(ByteBuffer[])

Runs a synchronous gathering write from all supplied buffers in a task at the file position, or at the end of the file in append mode, advancing the file position by the number of bytes written.

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

Parameters

srcs
ByteBuffer[]

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

Returns

A task whose result is the total number of bytes written, possibly zero. The result gives the actual count of bytes written from the 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

WriteAsync(ByteBuffer)

Runs a synchronous write in a task at this channel's file position, or at the end of the file in append mode, advancing the file position by the number of bytes written.

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

Parameters

src
ByteBuffer

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

Returns

A task whose result is the number of bytes written, possibly zero. The result gives the actual count of bytes written from 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

WriteAsync(ByteBuffer, Int64)

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

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

Parameters

src
ByteBuffer

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

position
Int64

The non-negative byte offset in the file at which to start writing. The file grows if needed; bytes in any gap before the written data have unspecified values.

Returns

A task whose result is the number of bytes written, possibly zero. The result gives the actual count of bytes written from 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

WriteAsync(ByteBuffer[], Int32, Int32)

Runs a synchronous gathering write from the selected buffers in a task at the file position, or at the end of the file in append mode, advancing the file position by the number of bytes written.

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

Parameters

srcs
ByteBuffer[]

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

offset
Int32

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

length
Int32

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

Returns

A task whose result is the total number of bytes written, possibly zero. The result gives the actual count of bytes written from the 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