Ejemplo 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());
         }
 }
Ejemplo 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));
         }
 }
Ejemplo n.º 3
0
 public byte[] InflateBytes(byte[] gzBuffer)
 {
     using var compressedStream = gzBuffer.InMemoryStream();
     using var zipStream        = new DeflateStream(compressedStream, CompressionMode.Decompress);
     return(zipStream.ReadFully());
 }