(Xojo Plugin) 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 Chilkat.FileAccess
Dim compressedBytes As MemoryBlock
compressedBytes = fac.ReadEntireFile("qa_data/compressed/compressedBmp.dat")
If (fac.LastMethodSuccess <> True) Then
System.DebugLog(fac.LastErrorText)
Return
End If
Dim compress As New Chilkat.Compression
compress.Algorithm = "deflate"
Dim decompressedBytes As MemoryBlock
decompressedBytes = compress.DecompressBytes(compressedBytes)
If (compress.LastMethodSuccess <> True) Then
System.DebugLog(compress.LastErrorText)
Return
End If
Dim success As Boolean
success = fac.WriteEntireFile("qa_output/decompressed.bmp",decompressedBytes)
If (fac.LastMethodSuccess <> True) Then
System.DebugLog(fac.LastErrorText)
Return
End If
|