skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
  • Docs & Support
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class OperationStream

Operational stream. Base class for cryptographic and compression streams.

Inheritance
System.Object
System.MarshalByRefObject
System.IO.Stream
OperationStream
CompressedStream
Inherited Members
System.IO.Stream.Null
System.IO.Stream.CopyToAsync(System.IO.Stream)
System.IO.Stream.CopyToAsync(System.IO.Stream, System.Int32)
System.IO.Stream.CopyToAsync(System.IO.Stream, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.CopyTo(System.IO.Stream)
System.IO.Stream.CopyTo(System.IO.Stream, System.Int32)
System.IO.Stream.Close()
System.IO.Stream.Dispose()
System.IO.Stream.FlushAsync()
System.IO.Stream.FlushAsync(System.Threading.CancellationToken)
System.IO.Stream.CreateWaitHandle()
System.IO.Stream.BeginRead(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)
System.IO.Stream.EndRead(System.IAsyncResult)
System.IO.Stream.ReadAsync(System.Byte[], System.Int32, System.Int32)
System.IO.Stream.ReadAsync(System.Byte[], System.Int32, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.BeginWrite(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)
System.IO.Stream.EndWrite(System.IAsyncResult)
System.IO.Stream.WriteAsync(System.Byte[], System.Int32, System.Int32)
System.IO.Stream.WriteAsync(System.Byte[], System.Int32, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.ReadByte()
System.IO.Stream.WriteByte(System.Byte)
System.IO.Stream.Synchronized(System.IO.Stream)
System.IO.Stream.ObjectInvariant()
System.IO.Stream.CanTimeout
System.IO.Stream.ReadTimeout
System.IO.Stream.WriteTimeout
System.MarshalByRefObject.MemberwiseClone(System.Boolean)
System.MarshalByRefObject.GetLifetimeService()
System.MarshalByRefObject.InitializeLifetimeService()
System.MarshalByRefObject.CreateObjRef(System.Type)
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.Windows.Zip
Assembly: Telerik.Windows.Zip.dll

Syntax

public abstract class OperationStream : Stream, IDisposable

Properties

CanRead

Gets a value indicating whether the current stream supports reading.

Declaration
public override bool CanRead { get; }
Property Value
System.Boolean

Overrides
System.IO.Stream.CanRead

CanSeek

Gets a value indicating whether the current stream supports seeking.

Declaration
public override bool CanSeek { get; }
Property Value
System.Boolean

Overrides
System.IO.Stream.CanSeek

CanWrite

Gets a value indicating whether the current stream supports writing.

Declaration
public override bool CanWrite { get; }
Property Value
System.Boolean

Overrides
System.IO.Stream.CanWrite

HasFlushedFinalBlock

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

Declaration
public bool HasFlushedFinalBlock { get; }
Property Value
System.Boolean

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

Length

Gets the length in bytes of the stream.

Declaration
public override long Length { get; }
Property Value
System.Int64

Overrides
System.IO.Stream.Length

Position

Gets or sets the position within the current stream.

Declaration
public override long Position { get; set; }
Property Value
System.Int64

Overrides
System.IO.Stream.Position

TotalPlainCount

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

Declaration
public long TotalPlainCount { get; }
Property Value
System.Int64

TotalTransformedCount

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

Declaration
public long TotalTransformedCount { get; }
Property Value
System.Int64

Methods

Dispose(Boolean)

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

Declaration
protected override void Dispose(bool disposing)
Parameters
System.Boolean disposing

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

Overrides
System.IO.Stream.Dispose(System.Boolean)

EnsureNotDisposed()

Ensure that current stream is not disposed.

Declaration
protected void EnsureNotDisposed()

Finalize()

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

Declaration
protected void Finalize()

Flush()

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

Declaration
public override void Flush()
Overrides
System.IO.Stream.Flush()

Read(Byte[], Int32, Int32)

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

Declaration
public override int Read(byte[] buffer, int offset, int count)
Parameters
System.Byte[] buffer

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.

System.Int32 offset

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

System.Int32 count

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

Returns
System.Int32

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.

Overrides
System.IO.Stream.Read(System.Byte[], System.Int32, System.Int32)
Exceptions
System.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.

System.ArgumentOutOfRangeException

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

System.ArgumentException

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

Read(Byte[], Int32, Int32, CancellationToken)

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

Declaration
protected int Read(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Parameters
System.Byte[] buffer

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.

System.Int32 offset

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

System.Int32 count

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

System.Threading.CancellationToken cancellationToken

The cancellation token used to cancel the operation

Returns
System.Int32

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
System.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.

System.ArgumentOutOfRangeException

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

System.ArgumentException

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

Seek(Int64, SeekOrigin)

Sets the position within the current stream.

Declaration
public override long Seek(long offset, SeekOrigin origin)
Parameters
System.Int64 offset

A byte offset relative to the origin parameter.

System.IO.SeekOrigin origin

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

Returns
System.Int64

The new position within the current stream.

Overrides
System.IO.Stream.Seek(System.Int64, System.IO.SeekOrigin)

SetLength(Int64)

Sets the length of the current stream.

Declaration
public override void SetLength(long value)
Parameters
System.Int64 value

The desired length of the current stream in bytes.

Overrides
System.IO.Stream.SetLength(System.Int64)

Write(Byte[], Int32, Int32)

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

Declaration
public override void Write(byte[] buffer, int offset, int count)
Parameters
System.Byte[] buffer

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

System.Int32 offset

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

System.Int32 count

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

Overrides
System.IO.Stream.Write(System.Byte[], System.Int32, System.Int32)

Extension Methods

StreamExtensions.ReadExactly(Stream, Byte[], Int32, Int32)
StreamExtensions.CopyToAsync(Stream, Stream, CancellationToken)
Getting Started
  • Getting Started
Support Resources
  • Documentation
Community
  • Forums
  • Blogs
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.