BackupDataOutput.WriteEntityDataAsync(Byte[], Int32) 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.
Runs WriteEntityData(Byte[], Int32) on a thread pool thread.
public System.Threading.Tasks.Task<int> WriteEntityDataAsync(byte[]? data, int size);
member this.WriteEntityDataAsync : byte[] * int -> System.Threading.Tasks.Task<int>
Parameters
- data
- Byte[]
The buffer containing the entity data to write.
- size
- Int32
The number of bytes to write from the start of data.
Returns
A task whose result is the status returned by WriteEntityData. The Android framework implementation returns zero on a successful write, not the number of bytes written.
Remarks
Write the entity header first. This .NET wrapper uses Task.Run to call the synchronous method. Await the task before changing the buffer or starting another operation on this output. The total entity data written must match the size specified in the header.
Do not use the result as a byte count to advance a buffer position or retry data. The wrapper forwards the synchronous result without converting it. See the Android native writer implementation.
.NET task wrapper implementation.
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.