コード例 #1
0
 public void Close()
 {
     //IL_008c: Unknown result type (might be due to invalid IL or missing references)
     if (cOut != null)
     {
         if (digestOut != null)
         {
             BcpgOutputStream bcpgOutputStream = new BcpgOutputStream((Stream)(object)digestOut, PacketTag.ModificationDetectionCode, 20L);
             ((Stream)bcpgOutputStream).Flush();
             ((Stream)digestOut).Flush();
             byte[] array = DigestUtilities.DoFinal(digestOut.WriteDigest());
             ((Stream)cOut).Write(array, 0, array.Length);
         }
         ((Stream)cOut).Flush();
         try
         {
             pOut.Write(c.DoFinal());
             pOut.Finish();
         }
         catch (global::System.Exception ex)
         {
             throw new IOException(ex.get_Message(), ex);
         }
         cOut = null;
         pOut = null;
     }
 }
コード例 #2
0
        /// <summary>Close the compressed object.</summary>summary>
        public void Close()
        {
            if (dOut != null)
            {
                //switch (algorithm)
                //{
                //	case CompressionAlgorithmTag.BZip2:
                //		// TODO No Finish method on BZip2OutputStream
                //		break;
                //	case CompressionAlgorithmTag.Zip:
                //	case CompressionAlgorithmTag.ZLib:
                //		((DeflaterOutputStream) dOut).Finish();
                //		break;
                //}
                //dOut.Flush();

                // TODO IgnoreClose stuff is a workaround for BZip2OutputStream problem above
                pkOut.IgnoreClose = true;
                dOut.Close();
                pkOut.IgnoreClose = false;

                pkOut.Finish();
                pkOut.Flush();

                dOut  = null;
                pkOut = null;
            }
        }
コード例 #3
0
        /// <summary>Close the compressed object.</summary>summary>
        public void Close()
        {
            if (dOut != null)
            {
                switch (algorithm)
                {
                case CompressionAlgorithmTag.BZip2:
                    ((CBZip2OutputStream)dOut).Finish();
                    break;

                case CompressionAlgorithmTag.Zip:
                case CompressionAlgorithmTag.ZLib:
                    ((ZDeflaterOutputStream)dOut).Finish();
                    break;
                }

                dOut.Flush();

                pkOut.Finish();
                pkOut.Flush();

                dOut  = null;
                pkOut = null;
            }
        }
コード例 #4
0
 public void Close()
 {
     if (cOut != null)
     {
         if (digestOut != null)
         {
             BcpgOutputStream bcpgOutputStream = new BcpgOutputStream(digestOut, PacketTag.ModificationDetectionCode, 20L);
             bcpgOutputStream.Flush();
             digestOut.Flush();
             byte[] array = DigestUtilities.DoFinal(digestOut.WriteDigest());
             cOut.Write(array, 0, array.Length);
         }
         cOut.Flush();
         try
         {
             pOut.Write(c.DoFinal());
             pOut.Finish();
         }
         catch (Exception ex)
         {
             throw new IOException(ex.Message, ex);
         }
         cOut = null;
         pOut = null;
     }
 }
コード例 #5
0
 /// <summary>
 /// Close the literal data packet - this is equivalent to calling Close()
 /// on the stream returned by the Open() method.
 /// </summary>
 public void Close()
 {
     if (pkOut != null)
     {
         pkOut.Finish();
         pkOut.Flush();
         pkOut = null;
     }
 }
コード例 #6
0
 public void Close()
 {
     if (pkOut != null)
     {
         pkOut.Finish();
         ((Stream)pkOut).Flush();
         pkOut = null;
     }
 }
コード例 #7
0
 /// <summary>
 ///     Close the literal data packet - this is equivalent to calling Close()
 ///     on the stream returned by the Open() method.
 /// </summary>
 public void Close()
 {
     if (_pkOut != null)
     {
         _pkOut.Finish();
         _pkOut.Flush();
         _pkOut = null;
     }
 }
コード例 #8
0
        /// <summary>
        /// Close the literal data packet - this is equivalent to calling Close()
        /// on the stream returned by the Open() method.
        /// </summary>
        public void Close()
        {
            if (_pkOut == null)
            {
                return;
            }

            _pkOut.Finish();
            _pkOut.Flush();
            _pkOut = null;
        }
コード例 #9
0
 public void Close()
 {
     if (dOut != null)
     {
         if (dOut != pkOut)
         {
             Platform.Dispose(dOut);
         }
         dOut = null;
         pkOut.Finish();
         ((Stream)pkOut).Flush();
         pkOut = null;
     }
 }
コード例 #10
0
        /// <summary>Close the compressed object.</summary>
        /// summary>
        public void Close()
        {
            if (_dOut != null)
            {
                if (_dOut != _pkOut)
                {
                    _dOut.Flush();
                    _dOut.Dispose();
                }

                _dOut = null;

                _pkOut.Finish();
                _pkOut.Flush();
                _pkOut = null;
            }
        }
コード例 #11
0
        /// <summary>
        /// <p>
        /// Close off the encrypted object - this is equivalent to calling Close() on the stream
        /// returned by the Open() method.
        /// </p>
        /// <p>
        /// <b>Note</b>: This does not close the underlying output stream, only the stream on top of
        /// it created by the Open() method.
        /// </p>
        /// </summary>
        public void Close()
        {
            if (cOut != null)
            {
                // TODO Should this all be under the try/catch block?
                if (digestOut != null)
                {
                    //
                    // hand code a mod detection packet
                    //
                    BcpgOutputStream bOut = new BcpgOutputStream(
                        digestOut, PacketTag.ModificationDetectionCode, 20);

                    bOut.Flush();
                    digestOut.Flush();

                    // TODO
                    byte[] dig = DigestUtilities.DoFinal(digestOut.WriteDigest());
                    cOut.Write(dig, 0, dig.Length);
                }

                cOut.Flush();

                try
                {
                    pOut.Write(c.DoFinal());
                    pOut.Finish();
                }
                catch (Exception e)
                {
                    throw new IOException(e.Message, e);
                }

                cOut = null;
                pOut = null;
            }
        }