예제 #1
0
        /// <summary>
        /// Creates a new instance of a IRandomAccessStream over the same resource as the current stream.
        /// </summary>
        /// <returns>The new stream. The initial, internal position of the stream is 0.</returns>
        public IRandomAccessStream CloneStream()
        {
            BlobReadStream       clonedStream = new BlobReadStream(this.originalStream);
            BlobReadStreamHelper clonedHelper = new BlobReadStreamHelper(clonedStream);

            return(clonedHelper);
        }
예제 #2
0
 /// <summary>
 /// Opens a stream for reading from the blob.
 /// </summary>
 /// <param name="accessCondition">An <see cref="AccessCondition"/> object that represents the access conditions for the blob. If <c>null</c>, no condition is used.</param>
 /// <param name="options">A <see cref="BlobRequestOptions"/> object that specifies any additional options for the request.</param>
 /// <param name="operationContext">An <see cref="OperationContext"/> object that represents the context for the current operation.</param>
 /// <returns>A stream to be used for reading from the blob.</returns>
 public IAsyncOperation<IRandomAccessStreamWithContentType> OpenReadAsync(AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
 {
     BlobRequestOptions modifiedOptions = BlobRequestOptions.ApplyDefaults(options, BlobType.PageBlob, this.ServiceClient);
     IRandomAccessStreamWithContentType stream = new BlobReadStreamHelper(this, accessCondition, modifiedOptions, operationContext);
     return Task.FromResult(stream).AsAsyncOperation();
 }