本文整理汇总了C#中Ionic.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Ionic.Dispose方法的具体用法?C# Ionic.Dispose怎么用?C# Ionic.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ionic
的用法示例。
在下文中一共展示了Ionic.Dispose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FinishOutputStream
internal void FinishOutputStream(Stream s,
CountingStream entryCounter,
Stream encryptor,
Stream compressor,
Ionic.Crc.CrcCalculatorStream output)
{
if (output == null) return;
output.Dispose();
// by calling Close() on the deflate stream, we write the footer bytes, as necessary.
if ((compressor as Ionic.Zlib.DeflateStream) != null)
compressor.Dispose();
#if BZIP
else if ((compressor as Ionic.BZip2.BZip2OutputStream) != null)
(compressor as Ionic.BZip2.BZip2OutputStream).Close();
#if !NETCF
else if ((compressor as Ionic.BZip2.ParallelBZip2OutputStream) != null)
(compressor as Ionic.BZip2.ParallelBZip2OutputStream).Close();
#endif
#endif
#if !NETCF
else if ((compressor as Ionic.Zlib.ParallelDeflateOutputStream) != null)
(compressor as Ionic.Zlib.ParallelDeflateOutputStream).Close();
#endif
encryptor.Flush();
encryptor.Dispose();
_LengthOfTrailer = 0;
_UncompressedSize = output.TotalBytesSlurped;
#if AESCRYPTO
WinZipAesCipherStream wzacs = encryptor as WinZipAesCipherStream;
if (wzacs != null && _UncompressedSize > 0)
{
s.Write(wzacs.FinalAuthentication, 0, 10);
_LengthOfTrailer += 10;
}
#endif
_CompressedFileDataSize = entryCounter.BytesWritten;
_CompressedSize = _CompressedFileDataSize; // may be adjusted
_Crc32 = output.Crc;
// Set _RelativeOffsetOfLocalHeader now, to allow for re-streaming
StoreRelativeOffset();
}