Gzip

Gzip (ODC)

Stable version 0.1.1 (Compatible with ODC)
Uploaded on 06 September 2024 by valantic LCS
Gzip

Gzip (ODC)

Documentation
0.1.1

This component allows you to compress and decompress data using the GZip algorithm. You can use this component to reduce the size of your data and save storage space or bandwidth. This component offers two actions: GZipCompress and GZipDecompress.

This component has an Outsystems extension in C# / .net and uses using System.IO.Compression to perform the compression and decompression operations. This directive was introduced in .NET Framework 4.5 to provide classes that support the compression and decompression of files and streams using various algorithms, such as GZip. Before that, it was necessary to use third-party libraries or native code to perform these operations. This directive made it easier to work with compressed files and data in C# and other .NET languages.

Gzip encoded webservice use case (SAP Hana, etc)

If you want to configure a service that is encoded with the Gzip format and the OutSystems automation cannot automatically resolve the answer because it is encoded.


Usage

The component offers two actions to compress and decompress data using the GZip algorithm:

  • GZipCompress: This action receives a text or a binary as input and returns a compressed binary using the GZip algorithm. The action has two input parameters:

    • Input: The text or the binary that will be compressed. This parameter is mandatory.
    • IsText: A boolean value that indicates if the input is a text or a binary. If true, the input is treated as a text. If false, the input is treated as a binary. The default value is true.
  • The action has one output parameter:

    • Output: The compressed binary using the GZip algorithm.
  • This action uses using System.IO.Compression.GZipStream to create a compressed stream from the input data.

    For example, if you want to compress a text “Hello World” using this action, you can do something like this:


    The result will be a compressed binary with 23 bytes.

  • GZipDecompress: This action receives a compressed binary as input and returns a decompressed text or binary using the GZip algorithm. The action has two input parameters:

    • Input: The compressed binary that will be decompressed. This parameter is mandatory.
    • IsText: A boolean value that indicates if the output is a text or a binary. If true, the output is treated as a text. If false, the output is treated as a binary. The default value is true.
  • The action has one output parameter:

    • Output: The decompressed text or binary using the GZip algorithm.
  • This action uses using System.IO.Compression.GZipStream to create a decompressed stream from the input data.

    For example, if you want to decompress a compressed binary with 23 bytes using this action, you can do something like this:


    The result will be a decompressed text “Hello World” with 11 bytes.