Syntax

$input.gunzip()

Description

Decompresses the given binary data that was compressed using the GZIP compression format, see GZIP compression.

Parameters

Name Type Description Mandatory Default
input Binary data The GZIP-compressed binary data to be decompressed. yes -
name String The name of the resulting binary value. no The name of the input with the suffix .gz removed, if present.
contentType String The content type of the resulting binary value. no Derived from the name of the result.

Return value

type: Binary data

The decompressed contents of the input.

Example

binary(name: "hello.txt", data: "Hello world!", encoding: "utf-8").gzip().gunzip()

Returns a binary value named "hello.txt" with the original contents of the text file.