[This topic is part of the Microsoft Azure Storage Client Library 1.7, which has been deprecated. See
Storage Client Library for the latest version.]
Returns an enumerable collection of the committed blocks comprising the blob.
Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)
Usage
Visual Basic |
---|
Dim instance As CloudBlockBlob
Dim returnValue As IEnumerable(Of ListBlockItem)
returnValue = instance.DownloadBlockList |
Syntax
Visual Basic |
---|
Public Function DownloadBlockList As IEnumerable(Of ListBlockItem) |
C# |
---|
public IEnumerable<ListBlockItem> DownloadBlockList () |
C++ |
---|
public:
IEnumerable<ListBlockItem^>^ DownloadBlockList () |
Return Value
Type: System.Collections.Generic.IEnumerable
An enumerable collection of objects implementing
ListBlockItem.
Example
The following code example downloads the block list for a blob and enumerates the blocks in the list. The example first downloads the committed blocks, then the uncommitted blocks, then the entire block list.
C# | Copy Code |
---|
static void DownloadBlockListForBlob(Uri blobEndpoint, string accountName, string accountKey)
{
//Create service client for credentialed access to the Blob service, using development storage.
CloudBlobClient blobClient = new CloudBlobClient(blobEndpoint,
new StorageCredentialsAccountAndKey(accountName, accountKey));
//Get a reference to a block blob.
CloudBlockBlob blockBlob = blobClient.GetBlockBlobReference("mycontainer/mybinaryblob.mp3");
//Download the committed blocks in the block list.
foreach (var blockListItem in blockBlob.DownloadBlockList())
{
Console.WriteLine("Block ID: " + blockListItem.Name);
Console.WriteLine("Block size: " + blockListItem.Size);
Console.WriteLine("Is block committed?: " + blockListItem.Committed);
Console.WriteLine();
}
//Download only uncommitted blocks.
foreach (var blockListItem in blockBlob.DownloadBlockList(BlockListingFilter.Uncommitted))
{
Console.WriteLine("Block ID: " + blockListItem.Name);
Console.WriteLine("Block size: " + blockListItem.Size);
Console.WriteLine("Is block committed?: " + blockListItem.Committed);
Console.WriteLine();
}
//Download all blocks.
foreach (var blockListItem in blockBlob.DownloadBlockList(BlockListingFilter.All))
{
Console.WriteLine("Block ID: " + blockListItem.Name);
Console.WriteLine("Block size: " + blockListItem.Size);
Console.WriteLine("Is block committed?: " + blockListItem.Committed);
Console.WriteLine();
}
} |
Remarks
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms
Change History
See Also