ASTA zlib Compression            


 

Zlib compression routines developed by ASTA user David Martin and licensed to ASTA users to be used only in ASTA applications

 

 

The Compression Level used by ASTA can be set by the

 

var

 AstaZLibCompressionSetting:Integer;

 

which by default is et to 1.

 

ASTA internally implements the try/except block mentioned in the following discussion.

 

 

procedure ZLibCompressString(var s: string; compressionLevel: Integer);

{ Compress string s using zlib (thread-safe). This is based on the

  same algorithm used in PKZip. compressionLevel may vary from 1 (best

  speed but worst compression) to 9 (slowest speed but best compression).

  A compressionLevel of 1 will usually give good speed with good

  compression. However, a higher compression level 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.

 

  NOTE: Errors may be trapped by placing this routine between a

  try..except block. (This ***should definitely*** be done on an ASTA

  server to prevent an exception dialog from halting the server.) }

 

procedure ZLibDecompressString(var s: string);

{ Decompress string s that was compressed using ZLibCompressString.

 

  NOTE: Errors may be trapped by placing this routine between a

  try..except block. (This ***should definitely*** be done on an ASTA

  server to prevent an exception dialog from halting the server.) }

 



ASTA Overview