Interface ICompressor
Defines a contract for compressing and decompressing data streams to optimize storage and transmission.
Namespace: Telerik.Reporting.Services.Engine
Assembly: Telerik.Reporting.dll
Syntax
public interface ICompressor
Remarks
Implementations of this interface provide compression capabilities for the Telerik Reporting engine, typically used to reduce the size of cached report data and improve performance. Common implementations include GZip, Deflate, and other compression algorithms.
Properties
EncodingType
Gets the encoding type identifier that represents the compression algorithm used by this compressor.
Declaration
string EncodingType { get; }
Property Value
|
System.String
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
Compress(Stream, Stream)
Compresses data from the source stream and writes the compressed result to the destination stream.
Declaration
void Compress(Stream source, Stream destination)
Parameters
|
System.IO.Stream
source
The input stream containing the data to be compressed. |
|
System.IO.Stream
destination
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.
Decompress(Stream, Stream)
Decompresses data from the source stream and writes the uncompressed result to the destination stream.
Declaration
void Decompress(Stream source, Stream destination)
Parameters
|
System.IO.Stream
source
The input stream containing the compressed data to be decompressed. |
|
System.IO.Stream
destination
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.