/// <summary> /// Returns an input stream at a specified location in a stream. /// </summary> /// <param name="position">The location in the stream at which to begin.</param> /// <returns>The input stream.</returns> public IInputStream GetInputStreamAt(ulong position) { BlobReadStream clonedStream = new BlobReadStream(this.originalStream); clonedStream.Seek((long)position, SeekOrigin.Begin); return(clonedStream.AsInputStream()); }
/// <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); return(new BlobReadStreamHelper(clonedStream)); }
/// <summary> /// Initializes a new instance of the BlobReadStreamHelper class. /// </summary> /// <param name="otherStream">An instance of BlobReadStream class that this helper should use.</param> private BlobReadStreamHelper(BlobReadStream otherStream) { this.originalStream = otherStream; this.originalStreamAsInputStream = this.originalStream.AsInputStream(); }
/// <summary> /// Initializes a new instance of the BlobReadStreamHelper class. /// </summary> /// <param name="blob">Blob reference to read from</param> /// <param name="accessCondition">An object that represents the access conditions for the blob. If null, no condition is used.</param> /// <param name="options">An object that specifies additional options for the request.</param> internal BlobReadStreamHelper(CloudBlob blob, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext) { this.originalStream = new BlobReadStream(blob, accessCondition, options, operationContext); this.originalStreamAsInputStream = this.originalStream.AsInputStream(); }