public DecompressStream(Stream underlyingStream) { this.underlyingStream = new StreamReaderWithUnread(underlyingStream); compressed = CheckMagicNumber(); if (compressed) { deflateStream = new DeflateStream(underlyingStream, CompressionMode.Decompress, leaveOpen: true); } }