Exemplo n.º 1
0
 public byte[] InflateBytes(byte[] gzBuffer)
 {
     using (var compressedStream = new MemoryStream(gzBuffer))
     using (var zipStream = new DeflateStream(compressedStream, CompressionMode.Decompress))
     {
         return zipStream.ReadFully();
     }
 }
Exemplo n.º 2
0
 public string Inflate(byte[] gzBuffer)
 {
     using (var compressedStream = new MemoryStream(gzBuffer))
     using (var zipStream = new DeflateStream(compressedStream, CompressionMode.Decompress))
     {
         var utf8Bytes = zipStream.ReadFully();
         return Encoding.UTF8.GetString(utf8Bytes);
     }
 }