/// <summary> /// Download data to the stream. /// </summary> /// <param name="blob">The cloud blob.</param> /// <param name="target">The byte array where to write to.</param> /// <param name="index">The offset index.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>The async task.</returns> public async Task <int> DownloadAsync(CloudPageBlob blob, byte[] target, int index, CancellationToken cancellationToken) { return(await blob.DownloadToByteArrayAsync(target, index, cancellationToken)); }
public static int DownloadToByteArray(this CloudPageBlob blob, byte[] buffer, int index) { return(blob.DownloadToByteArrayAsync(buffer, index).Result); }
/// <summary> /// Download data to the stream. /// </summary> /// <param name="blob">The cloud blob.</param> /// <param name="target">The byte array where to write to.</param> /// <param name="index">The offset index.</param> /// <returns>The async task.</returns> public async Task <int> DownloadAsync(CloudPageBlob blob, byte[] target, int index) { return(await blob.DownloadToByteArrayAsync(target, index)); }