.NET Core C#
.NET Core C#
Ungzip Base64 String
See more Gzip Examples
Suppose you have a gzip in base64 representation that contains a text file, such as XML. This example shows how to decompress and access the string.Chilkat .NET Core C# Downloads
bool success = false;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Chilkat.Gzip gzip = new Chilkat.Gzip();
string gzipBase64 = "H4sIAAAAAAAE ... X6aZjXO3EwAA";
Chilkat.BinData bd = new Chilkat.BinData();
success = bd.AppendEncoded(gzipBase64,"base64");
success = gzip.UncompressBd(bd);
if (success != true) {
Debug.WriteLine(gzip.LastErrorText);
return;
}
string strXml = bd.GetString("utf-8");
Debug.WriteLine("XML:");
Debug.WriteLine(strXml);