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 |
0 |
compressor uses fastest algorithm |
1 |
compressor uses fast algorithm |
2 |
compressor uses default algorithm |
3 |
compressor uses maximum compression, slowest algorithm |
The "gzip" method uses the following compression levels values:
Level |
Meaning |
0 |
no compression is used |
1 |
uses fastest algorithm, worst compression |
2 |
uses slower algorithm, better compression |
3 |
uses slower algorithm, better compression |
4 |
uses slower algorithm, better compression |
5 |
uses slower algorithm, better compression |
6 |
uses slower algorithm, better compression |
7 |
uses slower algorithm, better compression |
8 |
uses slower algorithm, better compression |
9 |
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.
|