C# Class Microsoft.WindowsAzure.Storage.Blob.BlobWriteStream

Inheritance: Microsoft.WindowsAzure.Storage.Blob.BlobWriteStreamBase
Show file Open project: Hitcents/azure-sdk-for-net-old Class Usage Examples

Public Methods

Method Description
Flush ( ) : void

Clears all buffers for this stream and causes any buffered data to be written to the underlying blob.

FlushAsync ( CancellationToken cancellationToken ) : System.Threading.Task

Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.

Seek ( long offset, SeekOrigin origin ) : long

Sets the position within the current stream.

Write ( byte buffer, int offset, int count ) : void

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

WriteAsync ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : System.Threading.Task

Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases the blob resources used by the Stream.

Private Methods

Method Description
BlobWriteStream ( Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob blockBlob, AccessCondition accessCondition, Microsoft.WindowsAzure.Storage.Blob.BlobRequestOptions options, OperationContext operationContext ) : System

Initializes a new instance of the BlobWriteStream class for a block blob.

BlobWriteStream ( Microsoft.WindowsAzure.Storage.Blob.CloudPageBlob pageBlob, long pageBlobSize, bool createNew, AccessCondition accessCondition, Microsoft.WindowsAzure.Storage.Blob.BlobRequestOptions options, OperationContext operationContext ) : System

Initializes a new instance of the BlobWriteStream class for a page blob.

CommitAsync ( ) : System.Threading.Task

Asynchronously commits the blob. For block blobs, this means uploading the block list. For page blobs, however, it only uploads blob properties.

DispatchWriteAsync ( ) : System.Threading.Task

Asynchronously dispatches a write operation.

WriteBlockAsync ( Stream blockData, string blockId, string blockMD5 ) : System.Threading.Task

Starts an asynchronous PutBlock operation as soon as the parallel operation semaphore becomes available.

Warning CS4014 is disabled here, since we intentionally do not await PutBlockAsync call.

WritePagesAsync ( Stream pageData, long offset, string contentMD5 ) : System.Threading.Task

Starts an asynchronous WritePages operation as soon as the parallel operation semaphore becomes available.

Warning CS4014 is disabled here, since we intentionally do not await WritePagesAsync call.

Method Details

Dispose() protected method

Releases the blob resources used by the Stream.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

Flush() public method

Clears all buffers for this stream and causes any buffered data to be written to the underlying blob.
public Flush ( ) : void
return void

FlushAsync() public method

Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.
public FlushAsync ( CancellationToken cancellationToken ) : System.Threading.Task
cancellationToken System.Threading.CancellationToken The token to monitor for cancellation requests.
return System.Threading.Task

Seek() public method

Sets the position within the current stream.
public Seek ( long offset, SeekOrigin origin ) : long
offset long A byte offset relative to the origin parameter.
origin SeekOrigin A value of type SeekOrigin indicating the reference /// point used to obtain the new position.
return long

Write() public method

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
public Write ( byte buffer, int offset, int count ) : void
buffer byte An array of bytes. This method copies count bytes from /// buffer to the current stream.
offset int The zero-based byte offset in buffer at which to begin /// copying bytes to the current stream.
count int The number of bytes to be written to the current stream.
return void

WriteAsync() public method

Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.
public WriteAsync ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : System.Threading.Task
buffer byte An array of bytes. This method copies count bytes from /// buffer to the current stream.
offset int The zero-based byte offset in buffer at which to begin /// copying bytes to the current stream.
count int The number of bytes to be written to the current stream.
cancellationToken System.Threading.CancellationToken The token to monitor for cancellation requests.
return System.Threading.Task