WriteBytesAsync() public static method

public static WriteBytesAsync ( [ file, [ buffer ) : IAsyncAction
file [
buffer [
return IAsyncAction
Ejemplo n.º 1
0
        private static async Task WriteBytesTaskAsync(string path, byte[] buffer, CancellationToken cancellationToken)
        {
            if (path is null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            var file = await StorageFile.GetFileFromPathAsync(path);

            await FileIO.WriteBytesAsync(file, buffer).AsTask(cancellationToken);
        }
 async public static Task WriteBytesAsync(this StorageFile file, byte[] buffer)
 {
     await FileIO.WriteBytesAsync(file, buffer);
 }