我正在使用Azure SDK v2.1.0.0。我在CloudBlockBlob类中找到了一个名为DownloadRangeToByteArray的方法,但遗憾的是我在在线MSDN中找不到任何关于它的文档?
关于它的使用,约束,线程安全的任何想法?
答案 0 :(得分:1)
从Azure存储客户端库的GitHub存储库https://github.com/WindowsAzure/azure-sdk-for-net/blob/583799d5238ffb72b8d9244604558a83ed4372f8/microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Blob/ICloudBlob.cs:
/// <summary>
/// Downloads the contents of a blob to a byte array.
/// </summary>
/// <param name="target">The target byte array.</param>
/// <param name="index">The starting offset in the byte array.</param>
/// <param name="blobOffset">The starting offset of the data range, in bytes.</param>
/// <param name="length">The length of the data range, in bytes.</param>
/// <param name="accessCondition">An <see cref="AccessCondition"/> object that represents the access conditions for the blob.</param>
/// <param name="options">A <see cref="BlobRequestOptions"/> object that specifies any additional options for the request.</param>
/// <param name="operationContext">An <see cref="OperationContext"/> object that represents the context for the current operation.</param>
/// <returns>The total number of bytes read into the buffer.</returns>
int DownloadRangeToByteArray(byte[] target, int index, long? blobOffset, long? length, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null);
答案 1 :(得分:1)
我为延迟道歉,内部出版链中存在导致文档被搁置的问题。他们应该很快出去。
同时上面的GitHub信息是正确的,这个方法的想法是它允许你指定blob字节的范围(而不是整个blob)直接下载到给定索引的字节数组中。