I am trying to download Azure blob using azure data movement library.
I am facing the issue where the Azure source blob size is set to "Zero" when I try to download this source blob using the APIs downloadRange
The destination file is downloaded correctly and its size is correct. Am I missing anything?
I am using azure-storage java sdk version 8.6.5. Here is the sample code
CloudStorageAccount storageAccount = CloudStorageAccount.Parse("myConnectionString");
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("myContainer");
CloudBlockBlob cloudBlockBlob = container.GetBlockBlobReference("abc.txt");
And this is loop where I am reading in chunks. Destination file size is correct. I just cannot figure why the source blob size is set to zero ? This is not reproducible when entire contents are downloaded using API download
try (OutputStream out = new ByteBufferBackedOutputStream(buffer)) {
cloudBlockBlob.downloadRange(position, (long) buffer.capacity(), out);
}...
Thanks in Advance!!