Table of Contents

Class EncryptUploadPartStream

Namespace
Amazon.Runtime.Internal.Util
Assembly
AWSSDK.Core.dll

A wrapper stream that encrypts the base stream as it is being read.

public abstract class EncryptUploadPartStream : WrapperStream, IDisposable, IAsyncDisposable
Inheritance
EncryptUploadPartStream
Implements
Derived
Inherited Members

Constructors

EncryptUploadPartStream(Stream)

Initializes an EncryptStream for Multipart uploads with an encryption algorithm and a base stream.

protected EncryptUploadPartStream(Stream baseStream)

Parameters

baseStream Stream

Stream to perform encryption on..

Properties

Algorithm

protected IEncryptionWrapper Algorithm { get; set; }

Property Value

IEncryptionWrapper

CanSeek

Gets a value indicating whether the current stream supports seeking.

public override bool CanSeek { get; }

Property Value

bool

InitializationVector

public byte[] InitializationVector { get; protected set; }

Property Value

byte[]

Length

Returns encrypted content length.

public override long Length { get; }

Property Value

long

Position

Gets or sets the position within the current stream.

public override long Position { get; set; }

Property Value

long

Methods

Read(byte[], int, int)

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

public override int Read(byte[] buffer, int offset, int count)

Parameters

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.

Returns

int

The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.

ReadAsync(byte[], int, int, CancellationToken)

Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests.

public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)

Parameters

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.

cancellationToken CancellationToken

The token to monitor for cancellation requests. The default value is System.Threading.CancellationToken.None.

Returns

Task<int>

A task that represents the asynchronous read operation. The value of the TResult parameter contains the total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.

Seek(long, SeekOrigin)

Sets the position within the current stream.

public override long Seek(long offset, SeekOrigin origin)

Parameters

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.

Returns

long

The new position within the current stream.