Topic Path: Symbol Reference > Types > TIdCompressionLevel Type
ContentsIndexHome
PreviousUpNext
TIdCompressionLevel Type
File
TIdCompressionLevel = 0..9;

TIdCompressionLevel is an enumerated type that represents the compression level values for the ZLIB compression library. 

TIdCompressionLevel is passed as a parameter to methods in TIdZLibCompressorBase to indicate the compression level flags written to a stream during compression, or expected during decompression. 

TIdCompressionLevel indicates the balance of algorithm speed and maximum compression required for the operation, and are available for use by specific compression methods ("deflate" or "gzip"). 

The "deflate" method uses the following compression levels values: 

 

Level 
Meaning 
compressor uses fastest algorithm 
compressor uses fast algorithm 
compressor uses default algorithm 
compressor uses maximum compression, slowest algorithm 

 

The "gzip" method uses the following compression levels values: 

 

Level 
Meaning 
no compression is used 
uses fastest algorithm, worst compression 
uses slower algorithm, better compression 
uses slower algorithm, better compression 
uses slower algorithm, better compression 
uses slower algorithm, better compression 
uses slower algorithm, better compression 
uses slower algorithm, better compression 
uses slower algorithm, better compression 
uses slowest algorithm, best compression 

 

A compression level value of 1 will usually give good speed with good compression. A higher compression level value may yield better performance when bandwith is at a premium because the total data transfer time is given by the sum of compression time + download time + decompression time. 

Please note that TIdCompressionLevel is not required for decompression; it is used to indicate if recompression might be worthwhile.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.