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); }