ICSharpCode.SharpZipLib.Zip.ZipInputStream.Dispose C# (CSharp) Method

Dispose() protected method

Closes the zip input stream
protected Dispose ( bool disposing ) : void
disposing bool
return void
        protected override void Dispose(bool disposing)
        {
            internalReader = new ReadDataHandler(ReadingNotAvailable);
            crc = null;
            entry = null;

            base.Dispose(disposing);
        }

Usage Example

Example #1
0
 /// <summary>
 /// 解压缩
 /// </summary>
 /// <param name="zipBytes">待解压数据</param>
 /// <returns></returns>
 public static byte[] UnZip(byte[] zipBytes)
 {
     ICSharpCode.SharpZipLib.Zip.ZipInputStream zipStream = null;
     ICSharpCode.SharpZipLib.Zip.ZipEntry       ent       = null;
     byte[] reslutBytes = null;
     try
     {
         using (System.IO.MemoryStream inputZipStream = new System.IO.MemoryStream(zipBytes))
         {
             zipStream = new ICSharpCode.SharpZipLib.Zip.ZipInputStream(inputZipStream);
             if ((ent = zipStream.GetNextEntry()) != null)
             {
                 reslutBytes = new byte[zipStream.Length];
                 zipStream.Read(reslutBytes, 0, reslutBytes.Length);
             }
         }
     }
     finally
     {
         if (zipStream != null)
         {
             zipStream.Close();
             zipStream.Dispose();
         }
         if (ent != null)
         {
             ent = null;
         }
         GC.Collect();
         GC.Collect(1);
     }
     return(reslutBytes);
 }
All Usage Examples Of ICSharpCode.SharpZipLib.Zip.ZipInputStream::Dispose