C# Класс Microsoft.WindowsAzure.StorageClient.BlobWriteStream

The class is an append-only stream for writing into storage.
Наследование: Microsoft.WindowsAzure.StorageClient.BlobStream
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
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

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Implements the disposing logic of committing the blob.

Приватные методы

Метод Описание
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

Описание методов

Abort() публичный Метод

Aborts the upload of the blob.
public Abort ( ) : void
Результат void

BeginCommit() публичный Метод

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.
Результат IAsyncResult

BeginWrite() публичный Метод

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.
Результат IAsyncResult

Commit() публичный Метод

Commits the blob on the server.
public Commit ( ) : void
Результат void

Dispose() защищенный Метод

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.
Результат void

EndCommit() публичный Метод

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.
Результат void

EndWrite() публичный Метод

B Ends an asynchronous write operation.
asyncResult is null
public EndWrite ( IAsyncResult asyncResult ) : void
asyncResult IAsyncResult An that references the pending asynchronous operation.
Результат void

Flush() публичный Метод

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
Результат void

Read() публичный Метод

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.
Результат int

Seek() публичный Метод

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.
Результат long

SetLength() публичный Метод

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.
Результат void

Write() публичный Метод

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.
Результат void

WriteByte() публичный Метод

Copies a single byte into the stream.
public WriteByte ( byte value ) : void
value byte The byte of data to be written.
Результат void