OpenStreamAsync() public method

Returns a stream to read the contents from Amazon S3 as specified by the TransferUtilityOpenStreamRequest. The caller of this method is responsible for closing the stream.
public OpenStreamAsync ( Amazon.S3.Transfer.TransferUtilityOpenStreamRequest request, CancellationToken cancellationToken = default(CancellationToken) ) : Task
request Amazon.S3.Transfer.TransferUtilityOpenStreamRequest /// Contains all the parameters required for the OpenStream operation. ///
cancellationToken System.Threading.CancellationToken /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
return Task
Example #1
2
 private async Task ReadObject(Stream stream, CancellationToken ct, string key)
 {
     using (var util = new TransferUtility(_s3))
     {
         using (Stream srcStream = await util.OpenStreamAsync(_bucket, key).ConfigureAwait(false))
         {
             await srcStream.CopyToAsync(stream, 64*1024, ct).ConfigureAwait(false);
         }
     }
 }