Table of Contents

Class ReadOnlyWrapperStream

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

Wrapper stream that only supports reading

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

Constructors

ReadOnlyWrapperStream(Stream)

public ReadOnlyWrapperStream(Stream baseStream)

Parameters

baseStream Stream

Properties

CanRead

Gets a value indicating whether the current stream supports reading. True if the stream supports reading; otherwise, false.

public override bool CanRead { get; }

Property Value

bool

CanSeek

Gets a value indicating whether the current stream supports seeking. True if the stream supports seeking; otherwise, false.

public override bool CanSeek { get; }

Property Value

bool

CanWrite

Gets a value indicating whether the current stream supports writing. True if the stream supports writing; otherwise, false.

public override bool CanWrite { get; }

Property Value

bool

Length

Gets the length in bytes of the stream.

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

Flush()

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.

public override void Flush()

FlushAsync(CancellationToken)

Asynchronously clears all buffers for this stream and causes any buffered data to be written to the underlying device.

public override Task FlushAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

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

Returns

Task

A task that represents the asynchronous flush operation.

Seek(long, SeekOrigin)

public override long Seek(long offset, SeekOrigin origin)

Parameters

offset long
origin SeekOrigin

Returns

long

SetLength(long)

public override void SetLength(long value)

Parameters

value long

Write(byte[], int, int)

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

Parameters

buffer byte[]
offset int
count int

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

Asynchronously writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)

Parameters

buffer byte[]

An array of bytes. This method copies count bytes from buffer to the current stream.

offset int

The zero-based byte offset in buffer at which to begin copying bytes to the current stream.

count int

The number of bytes to be written to the current stream.

cancellationToken CancellationToken

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

Returns

Task

A task that represents the asynchronous write operation.