Loading…

Kryptel/Java

ICompressorParams interface

Declaration

package com.kryptel.compressor;

public interface ICompressorParams {
    byte GetLevel() throws Exception;
    byte GetScheme() throws Exception;

    void SetLevel(byte level) throws Exception;
    void SetScheme(byte scheme) throws Exception;

    CompressorInfo GetInfo() throws Exception;
}

Description

This interface gets or sets compressor parameters. SetLevel and SetScheme should not be called inside an Init-Done sequence.

GetInfo

CompressorInfo GetInfo() throws Exception;

Returns the CompressorInfo structure describing the compressor.

GetLevel

byte GetLevel() throws Exception;

Returns the currently set compression level from 0 (no compression) to 9 (max compression). See also the CT_* named constants in the Constants class.

GetScheme

byte GetScheme() throws Exception;

Returns the currently set compressor variation (scheme). Most compressors don't have any variations, in which case this method just returns 1 (standard scheme).

SetLevel

void SetLevel(byte level) throws Exception;

Select compression level. The allowed values are from 0 (no compression) to 9 (max compression). It is recommended to use named constants CT_* defined in the Constants class. Value -1 (CT_DEFAULT_COMPRESSION) resets the compression level to the default value. The default level is defined by the specific compressor implementation; for example, for ZIP compressor it is 6 (CT_AVERAGE_COMPRESSION).

SetScheme

void SetScheme(byte scheme) throws Exception;

If the compressor exists in several variations, select one of them. Argument must be in the range 1 to N, where N is the number of available schemes. DEFAULT_VALUE selects the compressor's default scheme.