Gzip Delphi DLL Reference Documentation

Gzip

Current Version: 11.4.0

This class provides functionality for working with GZIP compression in both file-based and in-memory scenarios. It supports compressing and decompressing:

  • Files (.gz, .tar.gz)
  • Strings (with charset conversion)
  • Binary data (byte[], BinData)
  • Encoded data (Base64, Hex, etc.)

It also allows embedding metadata such as filenames, timestamps, and comments within the GZIP format.

For an extended overview, see Gzip Class Overview.

Create/Dispose

var
myObject: HCkGzip;

begin
myObject := CkGzip_Create();

// ...

CkGzip_Dispose(myObject);
end;
function CkGzip_Create: HCkGzip; stdcall;

Creates an instance of the HCkGzip object and returns a handle (i.e. a Pointer). The handle is passed in the 1st argument for the functions listed on this page.

procedure CkGzip_Dispose(handle: HCkGzip); stdcall;

Objects created by calling CkGzip_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function.

Properties

AbortCurrent
function CkGzip_getAbortCurrent(objHandle: HCkGzip): wordbool; stdcall;
procedure CkGzip_putAbortCurrent(objHandle: HCkGzip; newPropVal: wordbool); stdcall;
Introduced in version 9.5.0.58

Set this property to True to request that the currently running operation be aborted. This is useful for long-running operations such as large file compression or decompression. Methods that complete quickly are generally not affected.

If no method is currently running, the property is automatically reset to False when the next method begins. After an abort occurs, it is also reset to False. Both synchronous and asynchronous operations can be aborted. For synchronous calls, another thread must set this property.

top
Comment
procedure CkGzip_getComment(objHandle: HCkGzip; outPropVal: HCkString); stdcall;
procedure CkGzip_putComment(objHandle: HCkGzip; newPropVal: PWideChar); stdcall;
function CkGzip__comment(objHandle: HCkGzip): PWideChar; stdcall;

An optional comment to embed in the Gzip file when a Compress* method is called.

See the notes about PWideChar memory ownership and validity.

top
CompressionLevel
function CkGzip_getCompressionLevel(objHandle: HCkGzip): Integer; stdcall;
procedure CkGzip_putCompressionLevel(objHandle: HCkGzip; newPropVal: Integer); stdcall;
Introduced in version 9.5.0.50

Controls the compression level used when creating Gzip data. The value can range from 0 to 9.

  • 0 = no compression
  • 9 = maximum compression

The default value is 6, which is a typical balance between compression size and speed. Higher levels may take significantly more CPU time while producing only slightly smaller output, depending on the data.

top
DebugLogFilePath
procedure CkGzip_getDebugLogFilePath(objHandle: HCkGzip; outPropVal: HCkString); stdcall;
procedure CkGzip_putDebugLogFilePath(objHandle: HCkGzip; newPropVal: PWideChar); stdcall;
function CkGzip__debugLogFilePath(objHandle: HCkGzip): PWideChar; stdcall;

If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. This logging helps identify the context and history of Chilkat calls leading up to any crash or hang, aiding in debugging.

Enabling the VerboseLogging property provides more detailed information. This property is mainly used for debugging rare instances where a Chilkat method call causes a hang or crash, which should generally not happen.

Possible causes of hangs include:

  • A timeout property set to 0, indicating an infinite timeout.
  • A hang occurring within an event callback in the application code.
  • An internal bug in the Chilkat code causing the hang.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
Filename
procedure CkGzip_getFilename(objHandle: HCkGzip; outPropVal: HCkString); stdcall;
procedure CkGzip_putFilename(objHandle: HCkGzip; newPropVal: PWideChar); stdcall;
function CkGzip__filename(objHandle: HCkGzip): PWideChar; stdcall;

The filename to embed in the Gzip file when a Compress* method is called. Some Gzip extraction tools use this embedded filename as the default output filename.

See the notes about PWideChar memory ownership and validity.

top
HeartbeatMs
function CkGzip_getHeartbeatMs(objHandle: HCkGzip): Integer; stdcall;
procedure CkGzip_putHeartbeatMs(objHandle: HCkGzip; newPropVal: Integer); stdcall;

Specifies the interval, in milliseconds, between AbortCheck event callbacks. These callbacks allow an application to cancel certain long-running operations before they finish.

The default value is 0, which means no AbortCheck callbacks are triggered.

More Information and Examples
top
LastErrorHtml
procedure CkGzip_getLastErrorHtml(objHandle: HCkGzip; outPropVal: HCkString); stdcall;
function CkGzip__lastErrorHtml(objHandle: HCkGzip): PWideChar; stdcall;

Provides HTML-formatted information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

See the notes about PWideChar memory ownership and validity.

top
LastErrorText
procedure CkGzip_getLastErrorText(objHandle: HCkGzip; outPropVal: HCkString); stdcall;
function CkGzip__lastErrorText(objHandle: HCkGzip): PWideChar; stdcall;

Provides plain text information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

See the notes about PWideChar memory ownership and validity.

top
LastErrorXml
procedure CkGzip_getLastErrorXml(objHandle: HCkGzip; outPropVal: HCkString); stdcall;
function CkGzip__lastErrorXml(objHandle: HCkGzip): PWideChar; stdcall;

Provides XML-formatted information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

See the notes about PWideChar memory ownership and validity.

top
LastMethodSuccess
function CkGzip_getLastMethodSuccess(objHandle: HCkGzip): wordbool; stdcall;
procedure CkGzip_putLastMethodSuccess(objHandle: HCkGzip; newPropVal: wordbool); stdcall;

Indicates the success or failure of the most recent method call: True means success, False means failure. This property remains unchanged by property setters or getters. This method is present to address challenges in checking for null or Nothing returns in certain programming languages. Note: This property does not apply to methods that return integer values or to boolean-returning methods where the boolean does not indicate success or failure.

top
LastModStr
procedure CkGzip_getLastModStr(objHandle: HCkGzip; outPropVal: HCkString); stdcall;
procedure CkGzip_putLastModStr(objHandle: HCkGzip; newPropVal: PWideChar); stdcall;
function CkGzip__lastModStr(objHandle: HCkGzip): PWideChar; stdcall;

Specifies the last-modified date/time to embed in the Gzip file when a Compress* method is called.

The value must be provided as an RFC 822 formatted date/time string.

Example:

Tue, 15 Nov 1994 12:45:26 GMT

If this property is not set, the current system date/time is used automatically.

See the notes about PWideChar memory ownership and validity.

top
UseCurrentDate
function CkGzip_getUseCurrentDate(objHandle: HCkGzip): wordbool; stdcall;
procedure CkGzip_putUseCurrentDate(objHandle: HCkGzip; newPropVal: wordbool); stdcall;

Controls the last-modified date/time assigned to files created by Uncompress* methods.

When set to True, the extracted file uses the current date/time instead of the date/time stored in the Gzip data.

top
VerboseLogging
function CkGzip_getVerboseLogging(objHandle: HCkGzip): wordbool; stdcall;
procedure CkGzip_putVerboseLogging(objHandle: HCkGzip; newPropVal: wordbool); stdcall;

If set to True, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. The default value is False. Verbose logging should only be used for debugging. The potentially large quantity of logged information may adversely affect peformance.

top
Version
procedure CkGzip_getVersion(objHandle: HCkGzip; outPropVal: HCkString); stdcall;
function CkGzip__version(objHandle: HCkGzip): PWideChar; stdcall;

Version of the component/library, such as "10.1.0"

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top

Methods

CompressBd
function CkGzip_CompressBd(objHandle: HCkGzip;
    binDat: HCkBinData): wordbool; stdcall;
Introduced in version 9.5.0.67

Compresses the contents of a BinData object in place, replacing the original data with Gzip-compressed data.

Returns True for success, False for failure.

More Information and Examples
top
CompressBdAsync (1)
function CkGzip_CompressBdAsync(objHandle: HCkGzip;
    binDat: HCkBinData): HCkTask; stdcall;
Introduced in version 9.5.0.67

Creates an asynchronous task to call the CompressBd method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
CompressFile
function CkGzip_CompressFile(objHandle: HCkGzip;
    srcPath: PWideChar;
    destPath: PWideChar): wordbool; stdcall;

Compresses a file and writes the result as a Gzip file, typically with a .gz extension.

Returns True for success, False for failure.

More Information and Examples
top
CompressFileAsync (1)
function CkGzip_CompressFileAsync(objHandle: HCkGzip;
    srcPath: PWideChar;
    destPath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the CompressFile method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
CompressFile2
function CkGzip_CompressFile2(objHandle: HCkGzip;
    srcPath: PWideChar;
    embeddedFilename: PWideChar;
    destPath: PWideChar): wordbool; stdcall;

Compresses a file and writes the result as a Gzip file, while allowing a different filename to be embedded inside the Gzip data.

The inFilename parameter is the actual file on disk. The srcPath parameter is the filename stored in the Gzip header and may be used by extraction tools as the output filename.

Returns True for success, False for failure.

More Information and Examples
top
CompressFile2Async (1)
function CkGzip_CompressFile2Async(objHandle: HCkGzip;
    srcPath: PWideChar;
    embeddedFilename: PWideChar;
    destPath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the CompressFile2 method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
CompressFileBd
function CkGzip_CompressFileBd(objHandle: HCkGzip;
    filePath: PWideChar;
    bd: HCkBinData): wordbool; stdcall;
Introduced in version 11.0.0

Compresses a file and stores the resulting Gzip data in a BinData object.

The compressed output is held in memory. The maximum compressed size is 4 GB.

Returns True for success, False for failure.

top
CompressFileBdAsync (1)
function CkGzip_CompressFileBdAsync(objHandle: HCkGzip;
    filePath: PWideChar;
    bd: HCkBinData): HCkTask; stdcall;
Introduced in version 11.0.0

Creates an asynchronous task to call the CompressFileBd method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
CompressSb
function CkGzip_CompressSb(objHandle: HCkGzip;
    sb: HCkStringBuilder;
    charset: PWideChar;
    bd: HCkBinData): wordbool; stdcall;
Introduced in version 11.0.0

Compresses the text contained in a StringBuilder and writes the Gzip-compressed result to a BinData object.

Before compression, the string is converted to bytes using the specified character set, such as utf-8, iso-8859-1, or shift_JIS.

Returns True for success, False for failure.

top
CompressSbAsync (1)
function CkGzip_CompressSbAsync(objHandle: HCkGzip;
    sb: HCkStringBuilder;
    charset: PWideChar;
    bd: HCkBinData): HCkTask; stdcall;
Introduced in version 11.0.0

Creates an asynchronous task to call the CompressSb method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
CompressStringENC
function CkGzip_CompressStringENC(objHandle: HCkGzip;
    inStr: PWideChar;
    charset: PWideChar;
    encoding: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkGzip__compressStringENC(objHandle: HCkGzip;
    inStr: PWideChar;
    charset: PWideChar;
    encoding: PWideChar): PWideChar; stdcall;

Compresses a string and returns the Gzip-compressed data as an encoded string.

The input string is first converted to bytes using the specified character set. The compressed binary data is then encoded using the requested encoding, such as base64, hex, url, base32, or quoted-printable.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
CompressStringToFile
function CkGzip_CompressStringToFile(objHandle: HCkGzip;
    inStr: PWideChar;
    destCharset: PWideChar;
    destPath: PWideChar): wordbool; stdcall;

Compresses a string and writes the resulting Gzip data to a file.

The string is first converted to bytes using the character set specified by destCharset.

Returns True for success, False for failure.

top
CompressStringToFileAsync (1)
function CkGzip_CompressStringToFileAsync(objHandle: HCkGzip;
    inStr: PWideChar;
    destCharset: PWideChar;
    destPath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the CompressStringToFile method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
ExamineFile
function CkGzip_ExamineFile(objHandle: HCkGzip;
    filePath: PWideChar): wordbool; stdcall;

Checks whether the specified file contains Gzip-formatted data.

Returns True if the file is in Gzip format, or False otherwise.

More Information and Examples
top
IsGzip
function CkGzip_IsGzip(objHandle: HCkGzip;
    bd: HCkBinData): wordbool; stdcall;
Introduced in version 11.0.0

Checks whether the data contained in a BinData object is in Gzip format.

Returns True if the data is Gzip-formatted, or False otherwise.

top
LoadTaskCaller
function CkGzip_LoadTaskCaller(objHandle: HCkGzip;
    task: HCkTask): wordbool; stdcall;
Introduced in version 9.5.0.80

Loads the caller of the task's async method.

Returns True for success, False for failure.

top
SetDt
function CkGzip_SetDt(objHandle: HCkGzip;
    dt: HCkDateTime): wordbool; stdcall;

Sets the last-modified date/time to embed in the Gzip file when a Compress* method is called.

If no date/time is explicitly set, the current system date/time is used.

Returns True for success, False for failure.

More Information and Examples
top
SetExtraData
function CkGzip_SetExtraData(objHandle: HCkGzip;
    encodedData: PWideChar;
    encoding: PWideChar): wordbool; stdcall;
Introduced in version 11.0.0

Sets optional extra binary data to include in the Gzip header when a Compress* method is called.

The data is passed as an encoded string. Supported encodings include base64, hex, ascii, and many others.

Returns True for success, False for failure.

More Information and Examples
top
UncompressBd
function CkGzip_UncompressBd(objHandle: HCkGzip;
    binDat: HCkBinData): wordbool; stdcall;
Introduced in version 9.5.0.67

Decompresses Gzip data contained in a BinData object in place, replacing the compressed data with the uncompressed data.

Returns True for success, False for failure.

top
UncompressBdAsync (1)
function CkGzip_UncompressBdAsync(objHandle: HCkGzip;
    binDat: HCkBinData): HCkTask; stdcall;
Introduced in version 9.5.0.67

Creates an asynchronous task to call the UncompressBd method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
UncompressBdToFile
function CkGzip_UncompressBdToFile(objHandle: HCkGzip;
    bd: HCkBinData;
    filePath: PWideChar): wordbool; stdcall;
Introduced in version 11.0.0

Decompresses Gzip data stored in a BinData object and writes the result to a file.

Returns True for success, False for failure.

top
UncompressBdToFileAsync (1)
function CkGzip_UncompressBdToFileAsync(objHandle: HCkGzip;
    bd: HCkBinData;
    filePath: PWideChar): HCkTask; stdcall;
Introduced in version 11.0.0

Creates an asynchronous task to call the UncompressBdToFile method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
UncompressFile
function CkGzip_UncompressFile(objHandle: HCkGzip;
    srcPath: PWideChar;
    destPath: PWideChar): wordbool; stdcall;

Decompresses a Gzip file and writes the result to the specified output path.

The output filename is provided by the caller. The filename embedded in the Gzip data is not used.

Returns True for success, False for failure.

More Information and Examples
top
UncompressFileAsync (1)
function CkGzip_UncompressFileAsync(objHandle: HCkGzip;
    srcPath: PWideChar;
    destPath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the UncompressFile method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
UncompressFileToString
function CkGzip_UncompressFileToString(objHandle: HCkGzip;
    srcPath: PWideChar;
    charset: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkGzip__uncompressFileToString(objHandle: HCkGzip;
    srcPath: PWideChar;
    charset: PWideChar): PWideChar; stdcall;

Decompresses a Gzip file that contains text and returns the uncompressed text as a string.

The charset parameter specifies the character encoding of the uncompressed text, such as utf-8, iso-8859-1, windows-1252, shift_JIS, big5, etc.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
UncompressFileToStringAsync (1)
function CkGzip_UncompressFileToStringAsync(objHandle: HCkGzip;
    srcPath: PWideChar;
    charset: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the UncompressFileToString method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
UncompressStringENC
function CkGzip_UncompressStringENC(objHandle: HCkGzip;
    inStr: PWideChar;
    charset: PWideChar;
    encoding: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkGzip__uncompressStringENC(objHandle: HCkGzip;
    inStr: PWideChar;
    charset: PWideChar;
    encoding: PWideChar): PWideChar; stdcall;

Decompresses Gzip data provided as an encoded string and returns the uncompressed result as text.

The input string is first decoded using the specified encoding, such as base64, hex, url, base32, quoted-printable, etc. The decoded Gzip data is then decompressed and converted to text using the specified character set.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
UnTarGz
function CkGzip_UnTarGz(objHandle: HCkGzip;
    gzPath: PWideChar;
    destDir: PWideChar;
    bNoAbsolute: wordbool): wordbool; stdcall;

Extracts a .tar.gz archive to a directory.

The Gzip decompression and TAR extraction are performed in streaming mode. No temporary files are created, and memory usage remains small and constant.

If bNoAbsolute is True, absolute paths in the TAR archive are not allowed. This helps protect against extracting files to unsafe locations, such as system directories.

Returns True for success, False for failure.

top
UnTarGzAsync (1)
function CkGzip_UnTarGzAsync(objHandle: HCkGzip;
    gzPath: PWideChar;
    destDir: PWideChar;
    bNoAbsolute: wordbool): HCkTask; stdcall;

Creates an asynchronous task to call the UnTarGz method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
XfdlToXml
function CkGzip_XfdlToXml(objHandle: HCkGzip;
    xfldData: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkGzip__xfdlToXml(objHandle: HCkGzip;
    xfldData: PWideChar): PWideChar; stdcall;

Converts base64-encoded, Gzip-compressed XFDL data to XML text.

The input contains base64 data. The method decodes it, decompresses the Gzip data, and returns the resulting XML string.

XFDL (Extensible Forms Description Language) is an XML-based format used to define secure, interactive electronic forms—often including digital signatures and integrity protections—commonly used in government and enterprise applications.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top

Events

AbortCheck
function MyAbortCheck(): Integer; cdecl;
Introduced in version 9.5.0.82

Enables a method call to be aborted by triggering the AbortCheck event at intervals defined by the HeartbeatMs property. If HeartbeatMs is set to its default value of 0, no events will occur. For instance, set HeartbeatMs to 200 to trigger 5 AbortCheck events per second. Return True to abort; return False to continue (not abort)

More Information and Examples
top
PercentDone
function MyPercentDone(pctDone: Integer): Integer; cdecl;
Introduced in version 9.5.0.82

This provides the percentage completion for any method involving network communications or time-consuming processing, assuming the progress can be measured as a percentage. This event is triggered only when it's possible and logical to express the operation's progress as a percentage. The pctDone argument will range from 1 to 100. For methods that finish quickly, the number of PercentDone callbacks may vary, but the final callback will have pctDone equal to 100. For longer operations, callbacks will not exceed one per percentage point (e.g., 1, 2, 3, ..., 98, 99, 100).

The PercentDone callback also acts as an AbortCheck event. For fast methods where PercentDone fires, an AbortCheck event may not trigger since the PercentDone callback already provides an opportunity to abort. For longer operations, where time between PercentDone callbacks is extended, AbortCheck callbacks enable more responsive operation termination.

Return True to abort; return False to continue (not abort)

More Information and Examples
top
ProgressInfo
procedure MyProgressInfo(name: PWideChar; value: PWideChar) cdecl;
Introduced in version 9.5.0.82

This event callback provides tag name/value pairs that detail what occurs during a method call. To discover existing tag names, create code to handle the event, emit the pairs, and review them. Most tag names are self-explanatory.

More Information and Examples
top
TaskCompleted
procedure MyTaskCompleted(task: HCkTask) cdecl;
Introduced in version 9.5.0.82

Called from the background thread when an asynchronous task completes.

top

Deprecated

CompressFileToMem Deprecated
function CkGzip_CompressFileToMem(objHandle: HCkGzip;
    inFilename: PWideChar;
    outData: HCkByteData): wordbool; stdcall;

Compresses a file and returns the resulting Gzip data as a byte array.

The compressed output is held in memory and has a maximum size limit of 4 GB.

Returns True for success, False for failure.

top
CompressFileToMemAsync Deprecated (1)
function CkGzip_CompressFileToMemAsync(objHandle: HCkGzip;
    inFilename: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the CompressFileToMem method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
CompressMemory Deprecated
function CkGzip_CompressMemory(objHandle: HCkGzip;
    inData: HCkByteData;
    outData: HCkByteData): wordbool; stdcall;

Compresses a byte array and returns the result as an in-memory Gzip image.

The uncompressed input data must not exceed 4 GB.

Returns True for success, False for failure.

top
CompressMemoryAsync Deprecated (1)
function CkGzip_CompressMemoryAsync(objHandle: HCkGzip;
    inData: HCkByteData): HCkTask; stdcall;

Creates an asynchronous task to call the CompressMemory method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
CompressMemToFile Deprecated
function CkGzip_CompressMemToFile(objHandle: HCkGzip;
    inData: HCkByteData;
    destPath: PWideChar): wordbool; stdcall;

Compresses a byte array and writes the resulting Gzip data to a file.

Returns True for success, False for failure.

top
CompressMemToFileAsync Deprecated (1)
function CkGzip_CompressMemToFileAsync(objHandle: HCkGzip;
    inData: HCkByteData;
    destPath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the CompressMemToFile method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
CompressString Deprecated
function CkGzip_CompressString(objHandle: HCkGzip;
    inStr: PWideChar;
    destCharset: PWideChar;
    outBytes: HCkByteData): wordbool; stdcall;

Compresses a string and returns the Gzip-compressed data as a byte array.

The string is first converted to bytes using the character set specified by destCharset. Common values include utf-8, iso-8859-1, and shift_JIS.

Returns True for success, False for failure.

More Information and Examples
top
CompressStringAsync Deprecated (1)
function CkGzip_CompressStringAsync(objHandle: HCkGzip;
    inStr: PWideChar;
    destCharset: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the CompressString method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
Decode Deprecated
function CkGzip_Decode(objHandle: HCkGzip;
    encodedStr: PWideChar;
    encoding: PWideChar;
    outBytes: HCkByteData): wordbool; stdcall;
This method is deprecated.

Decodes an encoded string and returns the original data. The encoding mode is determined by encoding. It may be base64, hex, quoted-printable, or url.

Returns True for success, False for failure.

top
DeflateStringENC
function CkGzip_DeflateStringENC(objHandle: HCkGzip;
    inString: PWideChar;
    charsetName: PWideChar;
    outputEncoding: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkGzip__deflateStringENC(objHandle: HCkGzip;
    inString: PWideChar;
    charsetName: PWideChar;
    outputEncoding: PWideChar): PWideChar; stdcall;
This method is deprecated.

Compresses a string using the raw deflate algorithm and returns the compressed data as an encoded string.

The input string is first converted to bytes using the specified character set. The compressed binary data is then encoded using the requested output encoding, such as hex, base64, url, or quoted-printable.

Important: This method produces raw deflate-compressed data, not Gzip-format data. Use the Compress* methods when Gzip format output is required.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
Encode Deprecated
function CkGzip_Encode(objHandle: HCkGzip;
    byteData: HCkByteData;
    encoding: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkGzip__encode(objHandle: HCkGzip;
    byteData: HCkByteData;
    encoding: PWideChar): PWideChar; stdcall;
This method is deprecated.

Encodes binary data to a printable string. The encoding mode is determined by encoding. It may be base64, hex, quoted-printable, or url.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
ExamineMemory Deprecated
function CkGzip_ExamineMemory(objHandle: HCkGzip;
    inGzData: HCkByteData): wordbool; stdcall;

Checks whether the provided byte array contains Gzip-formatted data.

Returns True if the data is in Gzip format, or False otherwise.

top
GetDt
function CkGzip_GetDt(objHandle: HCkGzip): HCkDateTime; stdcall;
This method is deprecated.

Applications should instead access the LastModStr property.

Gets the last-modification date/time to be embedded within the .gz.

Returns nil on failure

top
InflateStringENC
function CkGzip_InflateStringENC(objHandle: HCkGzip;
    inString: PWideChar;
    convertFromCharset: PWideChar;
    inputEncoding: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkGzip__inflateStringENC(objHandle: HCkGzip;
    inString: PWideChar;
    convertFromCharset: PWideChar;
    inputEncoding: PWideChar): PWideChar; stdcall;
This method is deprecated.

Decompresses data previously compressed with DeflateStringENC.

The input string is first decoded using the specified input encoding, such as hex, base64, url, or quoted-printable. The resulting compressed bytes are then inflated, and the final bytes are converted to a string using the specified character set.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
ReadFile Deprecated
function CkGzip_ReadFile(objHandle: HCkGzip;
    path: PWideChar;
    outBytes: HCkByteData): wordbool; stdcall;
This method is deprecated.

Reads a binary file into memory and returns the byte array. Note: This method does not parse a Gzip, it is only a convenience method for reading a binary file into memory.

Returns True for success, False for failure.

top
UncompressFileToMem Deprecated
function CkGzip_UncompressFileToMem(objHandle: HCkGzip;
    srcPath: PWideChar;
    outData: HCkByteData): wordbool; stdcall;

Decompresses a Gzip file and returns the uncompressed data as a byte array.

The uncompressed output is held in memory and must not exceed 4 GB.

Returns True for success, False for failure.

top
UncompressFileToMemAsync Deprecated (1)
function CkGzip_UncompressFileToMemAsync(objHandle: HCkGzip;
    srcPath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the UncompressFileToMem method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
UncompressMemory Deprecated
function CkGzip_UncompressMemory(objHandle: HCkGzip;
    inData: HCkByteData;
    outData: HCkByteData): wordbool; stdcall;

Decompresses an in-memory Gzip image and returns the uncompressed data as a byte array.

The uncompressed output is held in memory and must not exceed 4 GB.

Returns True for success, False for failure.

top
UncompressMemoryAsync Deprecated (1)
function CkGzip_UncompressMemoryAsync(objHandle: HCkGzip;
    inData: HCkByteData): HCkTask; stdcall;

Creates an asynchronous task to call the UncompressMemory method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
UncompressMemToFile Deprecated
function CkGzip_UncompressMemToFile(objHandle: HCkGzip;
    inData: HCkByteData;
    destPath: PWideChar): wordbool; stdcall;

Decompresses an in-memory Gzip image and writes the uncompressed data to a file.

Returns True for success, False for failure.

top
UncompressMemToFileAsync Deprecated (1)
function CkGzip_UncompressMemToFileAsync(objHandle: HCkGzip;
    inData: HCkByteData;
    destPath: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the UncompressMemToFile method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
UncompressString Deprecated
function CkGzip_UncompressString(objHandle: HCkGzip;
    inData: HCkByteData;
    inCharset: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkGzip__uncompressString(objHandle: HCkGzip;
    inData: HCkByteData;
    inCharset: PWideChar): PWideChar; stdcall;

Decompresses Gzip-compressed data and returns the result as a string.

After decompression, the result is raw binary data (a sequence of bytes). These bytes are then interpreted as text using the specified character set (such as utf-8, iso-8859-1, etc.) to produce the final string.

Internally, Chilkat converts the byte sequence to a string by interpreting the bytes according to the specified character set. For example, if utf-8 is specified, the bytes are treated as the UTF-8 byte representation of text and decoded into the internal string format used by the programming language.

It is important that the character set matches the one originally used when the data was compressed. If the wrong character set is used, the byte-to-text conversion may produce incorrect or unreadable characters.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
UncompressStringAsync Deprecated (1)
function CkGzip_UncompressStringAsync(objHandle: HCkGzip;
    inData: HCkByteData;
    inCharset: PWideChar): HCkTask; stdcall;

Creates an asynchronous task to call the UncompressString method with the arguments provided.

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns nil on failure

top
WriteFile Deprecated
function CkGzip_WriteFile(objHandle: HCkGzip;
    path: PWideChar;
    binaryData: HCkByteData): wordbool; stdcall;
This method is deprecated.

A convenience method for writing a binary byte array to a file.

Returns True for success, False for failure.

top