public interface BlobManager
This interface provides methods for downloading blobs from MaxCompute storage. Both single blob download and batch download operations are supported.
Example usage for single blob download:
Blob blobRef = Blob.fromReference("blob_reference");
try (InputStream stream = blobManager.download(blobRef)) {
// Read data from stream
}
Example usage for batch blob download:
List<Blob> blobs = Arrays.asList(blob1, blob2, blob3);
try (BlobDataIterator iterator = blobManager.batchDownload(blobs)) {
while (iterator.hasNext()) {
try (InputStream stream = iterator.next()) {
// Read data from stream
}
}
}
| Modifier and Type | Method and Description |
|---|---|
BlobDataIterator |
batchDownload(List<Blob> blobs)
Downloads multiple blobs in batch.
|
InputStream |
download(Blob blobRef)
Downloads a single blob from MaxCompute storage.
|
InputStream download(Blob blobRef)
The returned InputStream must be closed by the caller to release resources. It is recommended to use try-with-resources to ensure the stream is properly closed.
blobRef - The blob reference to downloadBlobDownloadException - if the blob download failsMaxStorageException - if the blob does not exist or access is deniedClientException - if there is a client-side errorBlobDataIterator batchDownload(List<Blob> blobs)
The returned BlobDataIterator must be closed by the caller to release resources. It is recommended to use try-with-resources to ensure the iterator is properly closed.
The order of blobs returned by the iterator matches the order of the input list. If any blob fails to download, the iterator will throw a BlobDownloadException.
blobs - The list of blob references to downloadBlobDownloadException - if any blob download failsMaxStorageException - if any blob does not exist or access is deniedClientException - if there is a client-side errorCopyright © 2026 Alibaba Cloud Computing. All rights reserved.