FileUpload.uploadToBlobAsync(String blobName, InputStream inputStream, long streamLength, IotHubEventCallback statusCallback, Object statusCallbackContext) 方法

定义

Upload the file to container, which was associated to the iothub. This function will start the upload process, and back the execution to the caller. The upload process will be executed in background. When it is completed, the background thread will trigger the callback with the upload status.

public synchronized void uploadToBlobAsync(String blobName, InputStream inputStream, long streamLength, IotHubEventCallback statusCallback, Object statusCallbackContext)

参数

blobName
String

is the name of the file in the container.

inputStream
InputStream

is the input stream.

streamLength
long

is the stream length.

statusCallback
IotHubEventCallback

is the callback to notify that the upload is completed (with status).

statusCallbackContext
Object

is the context of the callback, allowing multiple uploads in parallel.

返回

synchronized void

例外

IllegalArgumentException

if one of the parameters is invalid. blobName isnull 

</code> or empty, inputStream is<code>null 

</code> or not available, streamLength is negative, statusCallback is<code>null 

</code></p>
IOException

if an I/O error occurs in the inputStream.

适用于