Sample code for 30+ languages & platforms
VB.NET

Decompress Bytes

See more Compression Examples

Demonstrates how to decompress binary data.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = 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 Byte
compressedBytes = fac.ReadEntireFile("qa_data/compressed/compressedBmp.dat")
If (fac.LastMethodSuccess <> True) Then
    Debug.WriteLine(fac.LastErrorText)
    Exit Sub
End If


Dim compress As New Chilkat.Compression
compress.Algorithm = "deflate"

Dim decompressedBytes() As Byte
decompressedBytes = compress.DecompressBytes(compressedBytes)
If (compress.LastMethodSuccess <> True) Then
    Debug.WriteLine(compress.LastErrorText)
    Exit Sub
End If


success = fac.WriteEntireFile("qa_output/decompressed.bmp",decompressedBytes)
If (fac.LastMethodSuccess <> True) Then
    Debug.WriteLine(fac.LastErrorText)
    Exit Sub
End If