MappedByteBuffer.ForceAsync 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
| Name | Description |
|---|---|
| ForceAsync() |
Runs Force() on a thread-pool thread to write changes to the mapped file's storage device. |
| ForceAsync(Int32, Int32) |
Runs Force(Int32, Int32) on a thread-pool thread to write changes in the specified region to the mapped file's storage device. |
ForceAsync()
Runs Force() on a thread-pool thread to write changes to the mapped file's storage device.
public System.Threading.Tasks.Task<Java.Nio.MappedByteBuffer?> ForceAsync();
member this.ForceAsync : unit -> System.Threading.Tasks.Task<Java.Nio.MappedByteBuffer>
Returns
A task whose result is the buffer returned by Force().
Remarks
This .NET wrapper uses Run<TResult>(Func<TResult>) to call the synchronous method. It does not use native asynchronous file I/O and has no cancellation parameter. The task completes when the synchronous call finishes and reports any exception from that call. The storage guarantees and mapping-mode restrictions of Force() also apply.
.NET asynchronous wrapper generator.
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
ForceAsync(Int32, Int32)
Runs Force(Int32, Int32) on a thread-pool thread to write changes in the specified region to the mapped file's storage device.
public System.Threading.Tasks.Task<Java.Nio.MappedByteBuffer?> ForceAsync(int index, int length);
member this.ForceAsync : int * int -> System.Threading.Tasks.Task<Java.Nio.MappedByteBuffer>
Parameters
- index
- Int32
The non-negative buffer index of the first byte to write. Must be less than the buffer's capacity.
- length
- Int32
The number of bytes to write. Must be non-negative and no greater than the buffer's capacity minus index.
Returns
A task whose result is the buffer returned by Force(Int32, Int32).
Remarks
This .NET wrapper uses Run<TResult>(Func<TResult>) to call the synchronous method. It does not use native asynchronous file I/O and has no cancellation parameter. The task completes when the synchronous call finishes and reports any exception from that call.
The region starts at index and contains length bytes. The storage guarantees and mapping-mode restrictions of Force(Int32, Int32) also apply. The underlying operation can write bytes outside this region to satisfy the storage device's block size.
.NET asynchronous wrapper generator.