コード例 #1
0
ファイル: ZipOutputStream.cs プロジェクト: zerje/DarkStealer
 // Token: 0x0600065D RID: 1629 RVA: 0x0003A4E8 File Offset: 0x000386E8
 protected override void Dispose(bool disposing)
 {
     if (this._disposed)
     {
         return;
     }
     if (disposing && !this._exceptionPending)
     {
         this._FinishCurrentEntry();
         this._directoryNeededZip64 = ZipOutput.WriteCentralDirectoryStructure(this._outputStream, this._entriesWritten.Values, 1U, this._zip64, this.Comment, new ZipContainer(this));
         CountingStream countingStream = this._outputStream as CountingStream;
         Stream         stream;
         if (countingStream != null)
         {
             stream = countingStream.WrappedStream;
             countingStream.Dispose();
         }
         else
         {
             stream = this._outputStream;
         }
         if (!this._leaveUnderlyingStreamOpen)
         {
             stream.Dispose();
         }
         this._outputStream = null;
     }
     this._disposed = true;
 }
コード例 #2
0
        protected override void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing) // not called from finalizer
            {
                // handle pending exceptions
                if (!_exceptionPending)
                {
                    _FinishCurrentEntry();
                    _directoryNeededZip64 = ZipOutput.WriteCentralDirectoryStructure(_outputStream,
                                                                                     _entriesWritten.Values,
                                                                                     1, // _numberOfSegmentsForMostRecentSave,
                                                                                     _zip64,
                                                                                     Comment,
                                                                                     new ZipContainer(this));
                    Stream         wrappedStream = null;
                    CountingStream cs            = _outputStream as CountingStream;
                    if (cs != null)
                    {
                        wrappedStream = cs.WrappedStream;
                        cs.Dispose();
                    }
                    else
                    {
                        wrappedStream = _outputStream;
                    }

                    if (!_leaveUnderlyingStreamOpen)
                    {
                        wrappedStream.Dispose();
                    }
                    _outputStream = null;
                }
            }
            _disposed = true;
        }