Loading…

Kryptel/Java

Compressors (package com.kryptel.compressor)

Description

This package contains Kryptel compressors, i.e. low-level components compressing a data block or an arbitrary length data stream. The included compressors are ZIP and NullCompressor.

Null compressor is a special 'compressor' component sending the input data to output 'as is', that is, performing no compression at all. It can be used for debugging, or when no compression is required. For example, high-level components such as Silver Key engine require a compressor component. There are two ways to turn compression off – either to set the compression level to CT_NO_COMPRESSION (see the Constants class), or to pass NullCompressor. The former is not reliable as some compressing libraries (BZIP, for instance) do not support no compression mode. Providing the NullCompressor component is a more reliable way (also NullCompressor will likely work faster).

Compressor Class Name Component ID
ZIP Zip CID_COMPRESSOR_ZIP
Null compressor NullCompressor CID_NULL_COMPRESSOR

Structures

CompressorInfo

A static structure describing allowed compressor parameters.

Interfaces

In addition to the standard component interfaces, any compressor component must export the following three interfaces:

ICompressor

Main compressor interface for compressing or decompressing data blocks of arbitrary size.

ICompressorParams

Gets or sets the compressor parameters.

IMemoryBlockCompressor

Compresses or decompresses in-memory data.

Examples

File Compression and Encryption

Improves File Encryption example by adding a compression step.