Skip to main content

Class GZipUtility

A helper/utility class containing GZip helper functions

public class GZipUtility

Inheritance​

object→GZipUtility

Methods​

Compress(string)​

Compresses the specified string using GZip compression.

public static byte[] Compress(string rawString)

Parameters​

NameTypeDescription
rawStringstringThe input string to compress.

Returns​

byte[] — A byte array containing the GZip-compressed representation of the input string.

Decompress(byte[])​

Decompresses a GZip-compressed byte[] into UTF-8 string.

public static string Decompress(byte[] compressedData)

Parameters​

NameTypeDescription
compressedDatabyte[]The GZip-compressed byte array.

Returns​

string — The decompressed UTF-8 string.

IsGZip(byte[])​

Determine if the byte array is compressed in GZip format

public static bool IsGZip(byte[] data)

Parameters​

NameTypeDescription
databyte[]Validation data

Returns​

bool — true:GZip format false:Not GZip format

  • Methods
    • Compress(string)
    • Decompress(byte[])
    • IsGZip(byte[])