ZipUncompressZlib2 Function

Action

Uncompresses a zipped data buffer, which was compressed with the ZipCompressZlib2 function.

Include file

Zip.bdh

Syntax

ZipUncompressZlib2( in  sSource   : string,
                    out sDest     : string ) : boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sSource Source buffer to be uncompressed.
sDest Destination buffer used to store the uncompressed data.

Example

transaction TMain
var
  sUnzipped: string;
  sZipped  : string;
  i        : number;

begin
  for i := 1 to sizeof(sUnzipped) do
    sUnzipped[i] := chr(ord('a') + ((i-1) mod 26));
end;
  ZipCompressZlib2(sUnzipped, sZipped);
  WriteLn("Size of unzipped buffer: " + string (Binlen(sUnzipped)));
  WriteLn("Size of zipped buffer: " + string (Binlen(sZipped)));
  ZipUncompressZlib2(sZipped, sUnzipped);

  WriteData(sUnzipped);
end TMain;

Output:

Size of unzipped buffer: 254

Size of zipped buffer:   37

abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst