Skip to content

Commit 19c2f1a

Browse files
Merge pull request #248706 from pauljewellmsft/pauljewell-java-download
Add download config section - Java
2 parents 43e3ee3 + 0e283a6 commit 19c2f1a

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

articles/storage/blobs/storage-blob-download-java.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services: storage
66
author: pauljewellmsft
77

88
ms.author: pauljewell
9-
ms.date: 08/02/2023
9+
ms.date: 09/08/2023
1010
ms.service: azure-blob-storage
1111
ms.topic: how-to
1212
ms.devlang: java
@@ -55,6 +55,27 @@ The following example downloads a blob by opening a `BlobInputStream` and readin
5555

5656
:::code language="java" source="~/azure-storage-snippets/blobs/howto/Java/blob-devguide/blob-devguide-blobs/src/main/java/com/blobs/devguide/blobs/BlobDownload.java" id="Snippet_ReadBlobStream":::
5757

58+
## Download a block blob with configuration options
59+
60+
You can define client library configuration options when downloading a blob. These options can be tuned to improve performance and enhance reliability. The following code examples show how to use [BlobDownloadToFileOptions](/java/api/com.azure.storage.blob.options.blobdownloadtofileoptions) to define configuration options when calling a download method.
61+
62+
### Specify data transfer options on download
63+
64+
You can configure values in [ParallelTransferOptions](/java/api/com.azure.storage.common.paralleltransferoptions) to improve performance for data transfer operations. The following values can be tuned for downloads based on the needs of your app:
65+
66+
- `blockSize`: The maximum block size to transfer for each request. You can set this value by using the [setBlockSizeLong](/java/api/com.azure.storage.common.paralleltransferoptions#com-azure-storage-common-paralleltransferoptions-setblocksizelong(java-lang-long)) method.
67+
- `maxConcurrency`: The maximum number of parallel requests issued at any given time as a part of a single parallel transfer. You can set this value by using the [setMaxConcurrency](/java/api/com.azure.storage.common.paralleltransferoptions#com-azure-storage-common-paralleltransferoptions-setmaxconcurrency(java-lang-integer)) method.
68+
69+
Add the following `import` directive to your file to use `ParallelTransferOptions`:
70+
71+
```java
72+
import com.azure.storage.common.*;
73+
```
74+
75+
The following code example shows how to set values for `ParallelTransferOptions` and include the options as part of a `BlobDownloadToFileOptions` instance. The values provided in this sample aren't intended to be a recommendation. To properly tune these values, you need to consider the specific needs of your app.
76+
77+
:::code language="java" source="~/azure-storage-snippets/blobs/howto/Java/blob-devguide/blob-devguide-blobs/src/main/java/com/blobs/devguide/blobs/BlobDownload.java" id="Snippet_DownloadBlobWithTransferOptions":::
78+
5879
## Resources
5980

6081
To learn more about how to download blobs using the Azure Blob Storage client library for Java, see the following resources.

0 commit comments

Comments
 (0)