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
public abstract class BlobOutputStream extends StorageOutputStream
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 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 Detail
-
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
public void close() throws IOException
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.
-
-