Sample code for 30+ languages & platforms
PowerShell

Decompress Bytes

See more Compression Examples

Demonstrates how to decompress binary data.

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$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

$fac = New-Object Chilkat.FileAccess

$compressedBytes = $fac.ReadEntireFile("qa_data/compressed/compressedBmp.dat")
if ($fac.LastMethodSuccess -ne $true) {
    $($fac.LastErrorText)
    exit
}

$compress = New-Object Chilkat.Compression
$compress.Algorithm = "deflate"

$decompressedBytes = $compress.DecompressBytes($compressedBytes)
if ($compress.LastMethodSuccess -ne $true) {
    $($compress.LastErrorText)
    exit
}

$success = $fac.WriteEntireFile("qa_output/decompressed.bmp",$decompressedBytes)
if ($fac.LastMethodSuccess -ne $true) {
    $($fac.LastErrorText)
    exit
}