(Visual Basic 6.0) 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
Dim fac As New CkFileAccess
Dim compressedBytes() As Byte
compressedBytes = fac.ReadEntireFile("qa_data/compressed/compressedBmp.dat")
If (fac.LastMethodSuccess <> 1) Then
Debug.Print fac.LastErrorText
Exit Sub
End If
Dim compress As New ChilkatCompression
compress.Algorithm = "deflate"
Dim decompressedBytes() As Byte
decompressedBytes = compress.DecompressBytes(compressedBytes)
If (compress.LastMethodSuccess <> 1) Then
Debug.Print compress.LastErrorText
Exit Sub
End If
Dim success As Long
success = fac.WriteEntireFile("qa_output/decompressed.bmp",decompressedBytes)
If (fac.LastMethodSuccess <> 1) Then
Debug.Print fac.LastErrorText
Exit Sub
End If
|