(AutoIt) Decompress Bytes
Demonstrates how to decompress binary data.
; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
; See this example to compress bytes: Compress Bytes
$oFac = ObjCreate("Chilkat_9_5_0.FileAccess")
Local $oCompressedBytes
$oCompressedBytes = $oFac.ReadEntireFile("qa_data/compressed/compressedBmp.dat")
If ($oFac.LastMethodSuccess <> True) Then
ConsoleWrite($oFac.LastErrorText & @CRLF)
Exit
EndIf
$oCompress = ObjCreate("Chilkat_9_5_0.Compression")
$oCompress.Algorithm = "deflate"
Local $oDecompressedBytes
$oDecompressedBytes = $oCompress.DecompressBytes($oCompressedBytes)
If ($oCompress.LastMethodSuccess <> True) Then
ConsoleWrite($oCompress.LastErrorText & @CRLF)
Exit
EndIf
Local $bSuccess = $oFac.WriteEntireFile("qa_output/decompressed.bmp",$oDecompressedBytes)
If ($oFac.LastMethodSuccess <> True) Then
ConsoleWrite($oFac.LastErrorText & @CRLF)
Exit
EndIf
|