New to Telerik ReportingStart a free 30-day trial

ICompressor

Interface

Defines a contract for compressing and decompressing data streams to optimize storage and transmission.

Definition

Namespace:Telerik.Reporting.Services.Engine

Assembly:Telerik.Reporting.dll

Syntax:

C#
public interface ICompressor

Properties

Gets the encoding type identifier that represents the compression algorithm used by this compressor.

C#
string EncodingType { get; }
Property Value:

A string that identifies the compression encoding type (e.g., "gzip", "deflate"). This value is used to identify the appropriate decompressor when reading compressed data.

Methods

Compresses data from the source stream and writes the compressed result to the destination stream.

C#
void Compress(Stream source, Stream destination)
Parameters:sourceStream

The input stream containing the data to be compressed.

destinationStream

The output stream where the compressed data will be written.

Remarks:

This method reads data from the source stream, applies the compression algorithm, and writes the compressed output to the destination stream. Both streams should be properly positioned before calling this method.

Decompresses data from the source stream and writes the uncompressed result to the destination stream.

C#
void Decompress(Stream source, Stream destination)
Parameters:sourceStream

The input stream containing the compressed data to be decompressed.

destinationStream

The output stream where the decompressed data will be written.

Remarks:

This method reads compressed data from the source stream, applies the decompression algorithm, and writes the uncompressed output to the destination stream. The source stream must contain data that was compressed using the same algorithm as this compressor.