I am in the process of creating a web application to download files from an azure blob storage container.
I have most of it working but sometimes receive the following the stacktrace error:-
java.lang.IllegalArgumentException: The argument must not be null or an empty string. Argument name: buffer.
at com.microsoft.azure.storage.core.Utility.assertNotNull(Utility.java:272)
at com.microsoft.azure.storage.blob.CloudBlob.downloadToByteArray(CloudBlob.java:1586)
at com.microsoft.azure.storage.blob.CloudBlob.downloadToByteArray(CloudBlob.java:1555)
at DSAengine.Cloudlet.download(Cloudlet.java:176)
The line of code which I am using to download the files to a bytearray is blob.downloadToByteArray(bytearr, 100000);
It is detailed that the '0' is a buffer for the bytearray, so I am guessing this is used to temporarily store information. But have no idea why it is required/what it does, and therefore do not understand how to solve this error, as the buffer is not null, and the error only occurs some of the time.
Any help is greatly appreciated!