ZipUncompressGzip2 Function

Action

Uncompresses a gzipped data buffer which was compressed with the ZipCompressGzip2 function.

Include file

Zip.bdh

Syntax

ZipUncompressGzip2( 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;
  nUnzipped: number;
  nZipped  : number;

begin
  nUnzipped := sizeof(sUnzipped);
  for i := 1 to sizeof(sUnzipped) do
    sUnzipped[i] := chr(ord('a') + ((i-1) mod 26));
end;
  ZipCompressGzip2(sUnzipped, sZipped);

  nZipped := sizeof(sZipped);
  WriteLn("Size of unzipped buffer: " + string(nUnzipped));
  WriteLn("Size of zipped buffer: " + string(nZipped));
  ZipUncompressGzip2(sZipped,sUnzipped);

  WriteData(sUnzipped);
endTMain;

Output:

Size of unzipped buffer: 254

Size of zipped buffer:   49

abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst