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