Exemplo n.º 1
0
 public virtual void Finish()
 {
     Deflater.Finish();
     while (!Deflater.IsFinished)
     {
         int length = Deflater.Deflate(_buffer, 0, _buffer.Length);
         if (length <= 0)
         {
             break;
         }
         if (_cryptoTransform != null)
         {
             EncryptBlock(_buffer, 0, length);
         }
         BaseOutputStream.Write(_buffer, 0, length);
     }
     if (!Deflater.IsFinished)
     {
         throw new SharpZipBaseException("Can't deflate all input?");
     }
     BaseOutputStream.Flush();
     if (_cryptoTransform != null)
     {
         ZipAESTransform transform = _cryptoTransform as ZipAESTransform;
         if (transform != null)
         {
             AesAuthCode = transform.GetAuthCode();
         }
         _cryptoTransform.Dispose();
         _cryptoTransform = null;
     }
 }