【发布时间】:2013-09-17 06:02:54
【问题描述】:
我正在使用 Azure SDK v2.1.0.0。我在 CloudBlockBlob 类中找到了一个名为 DownloadRangeToByteArray 的方法,但遗憾的是我在在线 MSDN 中找不到任何有关它的文档?
对它的用法、约束、线程安全有什么想法吗?
【问题讨论】:
标签: c# azure azure-storage
我正在使用 Azure SDK v2.1.0.0。我在 CloudBlockBlob 类中找到了一个名为 DownloadRangeToByteArray 的方法,但遗憾的是我在在线 MSDN 中找不到任何有关它的文档?
对它的用法、约束、线程安全有什么想法吗?
【问题讨论】:
标签: c# azure azure-storage
来自 Azure 存储客户端库 https://github.com/WindowsAzure/azure-sdk-for-net/blob/583799d5238ffb72b8d9244604558a83ed4372f8/microsoft-azure-api/Services/Storage/Lib/DotNetCommon/Blob/ICloudBlob.cs 的 GitHub 存储库:
/// <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);
【讨论】:
对于延迟,我深表歉意,内部发布链中存在导致文档被搁置的问题。他们应该很快就会出来。
同时,上面的 GitHub 信息是正确的,此方法的想法是它允许您指定 blob 字节的范围(而不是整个 blob)以直接下载到给定索引处的字节数组中。
【讨论】: