echo base64_encode(gzcompress($xml, 9))I also tried without the compression level or with a another number, but it's not working.
And here is the code i am using for decompression(C#):
public static string Decompress(string compressed)
{
byte[] compressedBytes = Convert.FromBase64String(compressed);
using (var mem = new MemoryStream())
{
mem.Write(new byte[] { 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, 8);
mem.Write(compressedBytes, 0, compressedBytes.Length);
mem.Position = 0;
using (var gzip = new GZipStream(mem, CompressionMode.Decompress))
using (var reader = new StreamReader(gzip))
{
return reader.ReadToEnd();
}
}
}
Can you help me, how i suppose to get the same result after decompression?


Sign In
Create Account


Back to top









