public GZipStream(Stream stream, CompressionMode mode, bool leaveOpen) {

            deflateStream = new DeflateStream(stream, mode, leaveOpen);
            SetDeflateStreamFileFormatter(mode);
        }
 protected override void Dispose(bool disposing) {
     try {
         if (disposing && deflateStream != null) {
             deflateStream.Dispose();
         }
         deflateStream = null;
     }
     finally {
         base.Dispose(disposing);
     }
 }