New to Telerik Document ProcessingStart a free 30-day trial

Operational stream. Base class for cryptographic and compression streams.

Definition

Namespace:Telerik.Windows.Zip

Assembly:Telerik.Windows.Zip.dll

Syntax:

C#
public abstract class OperationStream : Stream, IDisposable, IAsyncDisposable

Inheritance: objectMarshalByRefObjectStreamOperationStream

Derived Classes: CompressedStream

Implements: IAsyncDisposableIDisposable

Inherited Members Stream.NullStream.CopyTo(Stream)Stream.CopyTo(Stream, int)Stream.CopyToAsync(Stream)Stream.CopyToAsync(Stream, int)Stream.CopyToAsync(Stream, CancellationToken)Stream.CopyToAsync(Stream, int, CancellationToken)Stream.Dispose()Stream.Close()Stream.DisposeAsync()Stream.FlushAsync()Stream.FlushAsync(CancellationToken)Stream.CreateWaitHandle()Stream.BeginRead(byte[], int, int, AsyncCallback, object)Stream.EndRead(IAsyncResult)Stream.ReadAsync(byte[], int, int)Stream.ReadAsync(byte[], int, int, CancellationToken)Stream.ReadAsync(Memory<byte>, CancellationToken)Stream.ReadExactlyAsync(Memory<byte>, CancellationToken)Stream.ReadExactlyAsync(byte[], int, int, CancellationToken)Stream.ReadAtLeastAsync(Memory<byte>, int, bool, CancellationToken)Stream.BeginWrite(byte[], int, int, AsyncCallback, object)Stream.EndWrite(IAsyncResult)Stream.WriteAsync(byte[], int, int)Stream.WriteAsync(byte[], int, int, CancellationToken)Stream.WriteAsync(ReadOnlyMemory<byte>, CancellationToken)Stream.Read(Span<byte>)Stream.ReadByte()Stream.ReadExactly(Span<byte>)Stream.ReadExactly(byte[], int, int)Stream.ReadAtLeast(Span<byte>, int, bool)Stream.Write(ReadOnlySpan<byte>)Stream.WriteByte(byte)Stream.Synchronized(Stream)Stream.ObjectInvariant()Stream.ValidateBufferArguments(byte[], int, int)Stream.ValidateCopyToArguments(Stream, int)Stream.CanTimeoutStream.ReadTimeoutStream.WriteTimeoutMarshalByRefObject.GetLifetimeService()MarshalByRefObject.InitializeLifetimeService()MarshalByRefObject.MemberwiseClone(bool)...

Methods

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

C#
protected ~OperationStream()

Releases the unmanaged resources used by the Stream and optionally releases the managed resources.

C#
[SuppressMessage("Microsoft.Usage", "CA2215:Dispose methods should call base class dispose")]
protected override void Dispose(bool disposing)
Parameters:disposingbool

Value which indicates whether both managed and unmanaged resources (true) on only unmanaged resources (false) should be released.

Overrides: Stream.Dispose(bool)

Ensure that current stream is not disposed.

C#
protected void EnsureNotDisposed()

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

C#
public override void Flush()

Overrides: Stream.Flush()

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

C#
protected int Read(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Parameters:bufferbyte[]

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.

offsetint

The zero-based byte offset in buffer at which to begin storing the data read from the current stream.

countint

The maximum number of bytes to be read from the current stream.

cancellationTokenCancellationToken

The cancellation token used to cancel the operation

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.

Exceptions:

NotSupportedException

The StreamOperationMode associated with current OperationStream object does not match the underlying stream.
For example, this exception is thrown when using Read with an underlying stream that is write only.

ArgumentOutOfRangeException

The offset parameter is less than zero.-or- The count parameter is less than zero.

ArgumentException

The sum of the count and offset parameters is larger than the length of the buffer.

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

C#
public override int Read(byte[] buffer, int offset, int count)
Parameters:bufferbyte[]

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.

offsetint

The zero-based byte offset in buffer at which to begin storing the data read from the current stream.

countint

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.

Exceptions:

NotSupportedException

The StreamOperationMode associated with current OperationStream object does not match the underlying stream.
For example, this exception is thrown when using Read with an underlying stream that is write only.

ArgumentOutOfRangeException

The offset parameter is less than zero.-or- The count parameter is less than zero.

ArgumentException

The sum of the count and offset parameters is larger than the length of the buffer.

Overrides: Stream.Read(byte[], int, int)

Sets the position within the current stream.

C#
public override long Seek(long offset, SeekOrigin origin)
Parameters:offsetlong

A byte offset relative to the origin parameter.

originSeekOrigin

A value of type SeekOrigin indicating the reference point used to obtain the new position.

Returns:

long

The new position within the current stream.

Overrides: Stream.Seek(long, SeekOrigin)

Sets the length of the current stream.

C#
public override void SetLength(long value)
Parameters:valuelong

The desired length of the current stream in bytes.

Overrides: Stream.SetLength(long)

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

C#
public override void Write(byte[] buffer, int offset, int count)
Parameters:bufferbyte[]

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

offsetint

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

countint

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

Overrides: Stream.Write(byte[], int, int)

Properties

Gets a value indicating whether the current stream supports reading.

C#
public override bool CanRead { get; }

Overrides: Stream.CanRead

Gets a value indicating whether the current stream supports seeking.

C#
public override bool CanSeek { get; }

Overrides: Stream.CanSeek

Gets a value indicating whether the current stream supports writing.

C#
public override bool CanWrite { get; }

Overrides: Stream.CanWrite

Gets a value which indicates whether the final buffer block has been written/read to/from the underlying stream.

C#
public bool HasFlushedFinalBlock { get; }
Property Value:

true if the final block has been flushed or end of underlying stream is reached; otherwise, false.

Gets the length in bytes of the stream.

C#
public override long Length { get; }

Overrides: Stream.Length

Gets or sets the position within the current stream.

C#
public override long Position { get; set; }

Overrides: Stream.Position

Gets value which specify total plain bytes count (not-compressed and not-encrypted).

C#
public long TotalPlainCount { get; }

Gets value which specify total transformed bytes count (compressed or encrypted).

C#
public long TotalTransformedCount { get; }