C# Class Microsoft.WindowsAzure.StorageClient.BlobWriteStream

The class is an append-only stream for writing into storage.
Inheritance: Microsoft.WindowsAzure.StorageClient.BlobStream
Exibir arquivo Open project: richorama/azure-sdk-for-mono

Private Properties

Property Type Description
BlobWriteStream System
CheckWriteState void
CommitImpl System.Collections.Generic.IEnumerable
CreateNewBlock void
FlushInternal System.Collections.Generic.IEnumerable
GetBlockID string
ResetBlock void
SetBlobMD5 void
UploadBlob System.Collections.Generic.IEnumerable
UploadBlock System.Collections.Generic.IEnumerable
WriteBlockBlobImpl System.Collections.Generic.IEnumerable
WriteNonBlockedBlobImpl SynchronousTask

Public Methods

Method Description
Abort ( ) : void

Aborts the upload of the blob.

BeginCommit ( AsyncCallback callback, object state ) : IAsyncResult

Begins an asynchronous operation to commit the blob.

BeginWrite ( byte buffer, int offset, int count, AsyncCallback callback, object state ) : IAsyncResult

Begins an asynchronous write operation.

The operation will be completed synchronously if the buffer is not filled

Commit ( ) : void

Commits the blob on the server.

EndCommit ( IAsyncResult asyncResult ) : void

Ends an asynchronous operation to commit the blob.

EndWrite ( IAsyncResult asyncResult ) : void

B Ends an asynchronous write operation.

Flush ( ) : void

Causes any buffered data to be written to the remote storage. If the blob is not using blocks, the blob is fully committed.

Read ( byte buffer, int offset, int count ) : int

The stream does not support reading.

Seek ( long offset, SeekOrigin origin ) : long

The stream does not support seeking.

SetLength ( long value ) : void

The stream does not support setting of length.

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

Write the provided data into the underlying stream.

WriteByte ( byte value ) : void

Copies a single byte into the stream.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Implements the disposing logic of committing the blob.

Private Methods

Method Description
BlobWriteStream ( CloudBlockBlob blob, BlobRequestOptions options, long blockSize ) : System

Initializes a new instance of the BlobWriteStream class.

CheckWriteState ( ) : void

Verifies that the blob is in writable state.

CommitImpl ( ) : System.Collections.Generic.IEnumerable

Commits the blob by uploading any remaining data and the blocklist asynchronously.

CreateNewBlock ( ) : void

Creates the new block and the block hash.

FlushInternal ( ) : System.Collections.Generic.IEnumerable

Implements the flushing sequence.

GetBlockID ( ) : string

Generates a blockID using the block's hash and a prefix.

ResetBlock ( ) : void

Resets the block and the block hash.

SetBlobMD5 ( ) : void

Sets the MD5 of the blob.

UploadBlob ( ) : System.Collections.Generic.IEnumerable

Implements a sequence of events to upload a full blob.

UploadBlock ( ) : System.Collections.Generic.IEnumerable

Implements a sequence to upload a block.

WriteBlockBlobImpl ( byte buffer, int offset, int count ) : System.Collections.Generic.IEnumerable

Implements the block writing task.

WriteNonBlockedBlobImpl ( byte buffer, int offset, int count ) : SynchronousTask

Method Details

Abort() public method

Aborts the upload of the blob.
public Abort ( ) : void
return void

BeginCommit() public method

Begins an asynchronous operation to commit the blob.
public BeginCommit ( AsyncCallback callback, object state ) : IAsyncResult
callback AsyncCallback An optional asynchronous callback, to be called when the commit is complete.
state object A user-provided object that distinguishes this particular asynchronous commit request from other requests.
return IAsyncResult

BeginWrite() public method

Begins an asynchronous write operation.
The operation will be completed synchronously if the buffer is not filled
is null. offset or count is negative. Thrown if blob is already committed/closed
public BeginWrite ( byte buffer, int offset, int count, AsyncCallback callback, object state ) : IAsyncResult
buffer byte The buffer to write data from.
offset int The byte offset in buffer from which to begin writing.
count int The number of bytes to write.
callback AsyncCallback An optional asynchronous callback, to be called when the write is complete.
state object A user-provided object that distinguishes this particular asynchronous write request from other requests.
return IAsyncResult

Commit() public method

Commits the blob on the server.
public Commit ( ) : void
return void

Dispose() protected method

Implements the disposing logic of committing the blob.
protected Dispose ( bool disposing ) : void
disposing bool True to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

EndCommit() public method

Ends an asynchronous operation to commit the blob.
asyncResult is null
public EndCommit ( IAsyncResult asyncResult ) : void
asyncResult IAsyncResult An that references the pending asynchronous operation.
return void

EndWrite() public method

B Ends an asynchronous write operation.
asyncResult is null
public EndWrite ( IAsyncResult asyncResult ) : void
asyncResult IAsyncResult An that references the pending asynchronous operation.
return void

Flush() public method

Causes any buffered data to be written to the remote storage. If the blob is not using blocks, the blob is fully committed.
An I/O error occurs while writing to storage.
public Flush ( ) : void
return void

Read() public method

The stream does not support reading.
Not supported operation as this is a write-only stream
public Read ( byte buffer, int offset, int count ) : int
buffer byte An array of bytes. When this method returns, the buffer contains the specified byte array with the values /// between offset and (offset + count - 1) replaced by the bytes read from the current source.
offset int The zero-based byte offset in buffer at which to begin storing the data read from the current stream.
count int The maximum number of bytes to be read from the current stream.
return int

Seek() public method

The stream does not support seeking.
Not supported operation as this is a write-only stream
public Seek ( long offset, SeekOrigin origin ) : long
offset long A byte offset relative to the origin parameter.
origin SeekOrigin A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position.
return long

SetLength() public method

The stream does not support setting of length.
Growing a stream is not possible without writing.
public SetLength ( long value ) : void
value long The desired length of the current stream in bytes.
return void

Write() public method

Write the provided data into the underlying stream.
is null. offset or count is negative. Thrown if blob is already committed/closed
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

WriteByte() public method

Copies a single byte into the stream.
public WriteByte ( byte value ) : void
value byte The byte of data to be written.
return void