Sdílet prostřednictvím


CloudPageBlob.BeginOpenWrite Method

Definition

Overloads

BeginOpenWrite(Nullable<Int64>, AsyncCallback, Object)

Begins an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

BeginOpenWrite(Nullable<Int64>, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, Object)

Begins an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

BeginOpenWrite(Nullable<Int64>, AsyncCallback, Object)

Begins an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual Microsoft.Azure.Storage.ICancellableAsyncResult BeginOpenWrite (long? size, AsyncCallback callback, object state);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member BeginOpenWrite : Nullable<int64> * AsyncCallback * obj -> Microsoft.Azure.Storage.ICancellableAsyncResult
override this.BeginOpenWrite : Nullable<int64> * AsyncCallback * obj -> Microsoft.Azure.Storage.ICancellableAsyncResult
Public Overridable Function BeginOpenWrite (size As Nullable(Of Long), callback As AsyncCallback, state As Object) As ICancellableAsyncResult

Parameters

size
Nullable<Int64>

The size of the page blob, in bytes. The size must be a multiple of 512. If null, the page blob must already exist.

callback
AsyncCallback

An AsyncCallback delegate that will receive notification when the asynchronous operation completes.

state
Object

A user-defined object that will be passed to the callback delegate.

Returns

An ICancellableAsyncResult that references the asynchronous operation.

Attributes

Remarks

Note that this method always makes a call to the BeginFetchAttributes(AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, Object) method under the covers.

Set the StreamWriteSizeInBytes property before calling this method to specify the page size to write, in multiples of 512 bytes, ranging from between 512 and 4 MB inclusive.

To throw an exception if the blob exists instead of overwriting it, see BeginOpenWrite(Nullable<Int64>, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, Object).

Applies to

BeginOpenWrite(Nullable<Int64>, AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, Object)

Begins an asynchronous operation to open a stream for writing to the blob. If the blob already exists, then existing data in the blob may be overwritten.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual Microsoft.Azure.Storage.ICancellableAsyncResult BeginOpenWrite (long? size, Microsoft.Azure.Storage.AccessCondition accessCondition, Microsoft.Azure.Storage.Blob.BlobRequestOptions options, Microsoft.Azure.Storage.OperationContext operationContext, AsyncCallback callback, object state);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member BeginOpenWrite : Nullable<int64> * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext * AsyncCallback * obj -> Microsoft.Azure.Storage.ICancellableAsyncResult
override this.BeginOpenWrite : Nullable<int64> * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.Blob.BlobRequestOptions * Microsoft.Azure.Storage.OperationContext * AsyncCallback * obj -> Microsoft.Azure.Storage.ICancellableAsyncResult
Public Overridable Function BeginOpenWrite (size As Nullable(Of Long), accessCondition As AccessCondition, options As BlobRequestOptions, operationContext As OperationContext, callback As AsyncCallback, state As Object) As ICancellableAsyncResult

Parameters

size
Nullable<Int64>

The size of the page blob, in bytes. The size must be a multiple of 512. If null, the page blob must already exist.

accessCondition
AccessCondition

An AccessCondition object that represents the condition that must be met in order for the request to proceed. If null, no condition is used.

options
BlobRequestOptions

A BlobRequestOptions object that specifies additional options for the request.

operationContext
OperationContext

An OperationContext object that represents the context for the current operation.

callback
AsyncCallback

An AsyncCallback delegate that will receive notification when the asynchronous operation completes.

state
Object

A user-defined object that will be passed to the callback delegate.

Returns

An ICancellableAsyncResult that references the asynchronous operation.

Attributes

Remarks

Note that this method always makes a call to the BeginFetchAttributes(AccessCondition, BlobRequestOptions, OperationContext, AsyncCallback, Object) method under the covers.

Set the StreamWriteSizeInBytes property before calling this method to specify the page size to write, in multiples of 512 bytes, ranging from between 512 and 4 MB inclusive.

To throw an exception if the blob exists instead of overwriting it, pass in an AccessCondition object generated using GenerateIfNotExistsCondition().

Applies to