private void Close() { // Cleanup archive_stream.Close(); archive_stream = null; get_next_entry = null; Finished(); }
private void SetupArchiveStream() { this.count = 0; this.total_size = 0; switch (MimeType) { case "application/zip": archive_stream = new ZipInputStream(Stream); get_next_entry = GetNextEntryZip; archive_type = "zip"; break; case "application/x-bzip-compressed-tar": archive_stream = new TarInputStream(new BZip2InputStream(Stream)); get_next_entry = GetNextEntryTar; archive_type = "tar-bz2"; break; case "application/x-compressed-tar": case "application/x-tgz": archive_stream = new TarInputStream(new GZipInputStream(Stream)); get_next_entry = GetNextEntryTar; archive_type = "tar-gz"; break; case "application/x-tar": archive_stream = new TarInputStream(Stream); get_next_entry = GetNextEntryTar; archive_type = "tar"; break; case "application/x-gzip": archive_stream = new GZipInputStream(Stream); get_next_entry = GetNextEntrySingle; archive_type = "gzip"; break; case "application/x-bzip": archive_stream = new BZip2InputStream(Stream); get_next_entry = GetNextEntrySingle; archive_type = "bz2"; break; default: throw new ArgumentException("Invalid or unsupported mime type."); } setup_done = true; }
public bool MoveNext() { if (GetNextEntry == null) return false; this.Current = GetNextEntry(); if (this.Current == null) { this.GetNextEntry = null; return false; } return true; }
public bool MoveNext() { if (GetNextEntry == null) { return(false); } this.Current = GetNextEntry(); if (this.Current == null) { this.GetNextEntry = null; return(false); } return(true); }
private void SetupArchiveStream () { this.count = 0; this.total_size = 0; switch (MimeType) { case "application/zip": archive_stream = new ZipInputStream (Stream); get_next_entry = GetNextEntryZip; archive_type = "zip"; break; case "application/x-bzip-compressed-tar": archive_stream = new TarInputStream (new BZip2InputStream (Stream)); get_next_entry = GetNextEntryTar; archive_type = "tar-bz2"; break; case "application/x-compressed-tar": case "application/x-tgz": archive_stream = new TarInputStream (new GZipInputStream (Stream)); get_next_entry = GetNextEntryTar; archive_type = "tar-gz"; break; case "application/x-tar": archive_stream = new TarInputStream (Stream); get_next_entry = GetNextEntryTar; archive_type = "tar"; break; case "application/x-gzip": archive_stream = new GZipInputStream (Stream); get_next_entry = GetNextEntrySingle; archive_type = "gzip"; break; case "application/x-bzip": archive_stream = new BZip2InputStream (Stream); get_next_entry = GetNextEntrySingle; archive_type = "bz2"; break; default: throw new ArgumentException ("Invalid or unsupported mime type."); } setup_done = true; }
private void Close () { // Cleanup archive_stream.Close (); archive_stream = null; get_next_entry = null; Finished (); }