Class BlobOutputStream
java.lang.Object
java.io.OutputStream
com.azure.storage.common.StorageOutputStream
com.azure.storage.blob.specialized.BlobOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
BlobOutputStream allows for the uploading of data to a blob using a stream-like approach.
-
Field Summary
Fields inherited from class com.azure.storage.common.StorageOutputStream
lastError
-
Method Summary
Modifier and TypeMethodDescriptionstatic BlobOutputStream
blockBlobOutputStream
(BlobAsyncClient client, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions) Creates a block blob output stream from a BlobAsyncClientstatic BlobOutputStream
blockBlobOutputStream
(BlobAsyncClient client, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions, com.azure.core.util.Context context) Creates a block blob output stream from a BlobAsyncClientstatic BlobOutputStream
blockBlobOutputStream
(BlobAsyncClient client, BlockBlobOutputStreamOptions options, com.azure.core.util.Context context) Creates a block blob output stream from a BlobAsyncClientvoid
close()
Closes this output stream and releases any system resources associated with this stream.Methods inherited from class com.azure.storage.common.StorageOutputStream
checkStreamState, dispatchWrite, flush, write, write, write, writeInternal
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Method Details
-
blockBlobOutputStream
public static BlobOutputStream blockBlobOutputStream(BlobAsyncClient client, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions) Creates a block blob output stream from a BlobAsyncClient- Parameters:
client
-BlobAsyncClient
The blob client.parallelTransferOptions
-ParallelTransferOptions
used to configure buffered uploading.headers
-BlobHttpHeaders
metadata
- Metadata to associate with the blob. If there is leading or trailing whitespace in any metadata key or value, it must be removed or encoded.tier
-AccessTier
for the destination blob.requestConditions
-BlobRequestConditions
- Returns:
BlobOutputStream
associated with the blob.
-
blockBlobOutputStream
public static BlobOutputStream blockBlobOutputStream(BlobAsyncClient client, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions, com.azure.core.util.Context context) Creates a block blob output stream from a BlobAsyncClient- Parameters:
client
-BlobAsyncClient
The blob client.parallelTransferOptions
-ParallelTransferOptions
used to configure buffered uploading.headers
-BlobHttpHeaders
metadata
- Metadata to associate with the blob. If there is leading or trailing whitespace in any metadata key or value, it must be removed or encoded.tier
-AccessTier
for the destination blob.requestConditions
-BlobRequestConditions
context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
BlobOutputStream
associated with the blob.
-
blockBlobOutputStream
public static BlobOutputStream blockBlobOutputStream(BlobAsyncClient client, BlockBlobOutputStreamOptions options, com.azure.core.util.Context context) Creates a block blob output stream from a BlobAsyncClient- Parameters:
client
-BlobAsyncClient
The blob client.options
-BlockBlobOutputStreamOptions
context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
BlobOutputStream
associated with the blob.
-
close
Closes this output stream and releases any system resources associated with this stream. If any data remains in the buffer it is committed to the service.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classStorageOutputStream
- Throws:
IOException
- If an I/O error occurs.
-