Sample code for 30+ languages & platforms
Xojo Plugin

Decompress Bytes

See more Compression Examples

Demonstrates how to decompress binary data.

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = False

// 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

success = fac.WriteEntireFile("qa_output/decompressed.bmp",decompressedBytes)
If (fac.LastMethodSuccess <> True) Then
    System.DebugLog(fac.LastErrorText)
    Return
End If