Compression
Previous  Top  Next

:Compression - Default Compression Level.

Attributes

EXPORTED  

Datatype

Numeric (Z_DEFAULT_COMPRESSION)  

Description

This instance variable specifies the Default Compression Level for adding/updating (File) Entries to the Zip File with the :AddData() method. This value can be set directly or with the :New() or :Open() methods, and is initially set to XBZ_DEFAULT_COMPRESSION. It can also be queried/retrieved from outside the Class.  
 
This value is not persistent and is not saved with a Zip File! The specified new Compression Level will be used for the next data compression that is done with the :AddData() method as soon as it was set and will be used until it is manually changed or either the :Close(), :Open() or :New() method is called. The :Close() and :New() methods will reset the value to XBZ_DEFAULT_COMPRESSION, while a new value can be also specified with the :Open() or :New() methods.  
 
Possible values are the following Define Constants from the XbZLib.ch file:  
 
Define
Value
Description
XBZ_DEFAULT_COMPRESSION
-1
Default compression (similar to 6).
XBZ_NO_COMPRESSION
0
No compression, cannot be specified!
XBZ_BEST_SPEED
1
Minimum compression, fastest speed.
XBZ_BEST_COMPRESSION
9
Maximum compression, slowest speed.
 
 
Also possible are all integer values between 1 and 9 (for which no define constants exist), which determine the relation between Speed and Compression Ratio and give a finer granulation than the above listed Define values. But in virtually all cases, the Default Compression is the best compromise between compression ratio and speed. Using higher compression ratios will result in only very slightly smaller files, and using a better speed (lower compression ratio) will give only very small improvements in the speed!