Inheritance diagram for ICSharpCode::SharpZipLib::Zip::ZipInputStream:
Public Member Functions | |
ZipInputStream (Stream baseInputStream) | |
Creates a new Zip input stream, for reading a zip archive. | |
ZipEntry | GetNextEntry () |
Advances to the next entry in the archive. | |
void | CloseEntry () |
Closes the current zip entry and moves to the next one. | |
override int | ReadByte () |
Reads a byte from the current zip entry. | |
override int | Read (byte[] destination, int index, int count) |
Read a block of bytes from the stream. | |
int | BodyRead (byte[] b, int off, int len) |
Reads a block of bytes from the current zip entry. | |
override void | Close () |
Closes the zip input stream. | |
Properties | |
string | Password |
Optional password used for encryption when non-null. | |
bool | CanDecompressEntry |
Gets a value indicating if the entry can be decompressed. | |
override int | Available |
Returns 1 if there is an entry available Otherwise returns 0. | |
Private Member Functions | |
delegate int | ReaderDelegate (byte[] b, int offset, int length) |
void | ReadDataDescriptor () |
int | InitialRead (byte[] destination, int offset, int count) |
Private Attributes | |
ReaderDelegate | internalReader |
The current reader this instance. | |
Crc32 | crc = new Crc32() |
ZipEntry | entry = null |
long | size |
int | method |
int | flags |
string | password = null |
This sample shows how to read a zip file
using System; using System.Text; using System.IO; using ICSharpCode.SharpZipLib.Zip; class MainClass { public static void Main(string[] args) { ZipInputStream s = new ZipInputStream(File.OpenRead(args[0])); ZipEntry theEntry; while ((theEntry = s.GetNextEntry()) != null) { int size = 2048; byte[] data = new byte[2048]; Console.Write("Show contents (y/n) ?"); if (Console.ReadLine() == "y") { while (true) { size = s.Read(data, 0, data.Length); if (size > 0) { Console.Write(new ASCIIEncoding().GetString(data, 0, size)); } else { break; } } } } s.Close(); } }
Definition at line 97 of file ZipInputStream.cs.
|
Creates a new Zip input stream, for reading a zip archive.
Definition at line 118 of file ZipInputStream.cs. |
|
Reads a block of bytes from the current zip entry.
Definition at line 443 of file ZipInputStream.cs. |
|
Closes the zip input stream.
Reimplemented from ICSharpCode::SharpZipLib::Zip::Compression::Streams::InflaterInputStream. Definition at line 515 of file ZipInputStream.cs. |
|
Closes the current zip entry and moves to the next one.
Definition at line 285 of file ZipInputStream.cs. |
|
Advances to the next entry in the archive.
If the previous entry is still open CloseEntryCloseEntry is called.
Definition at line 167 of file ZipInputStream.cs. |
|
Definition at line 365 of file ZipInputStream.cs. References ICSharpCode::SharpZipLib::Encryption::PkzipClassicManaged::CreateDecryptor(). |
|
Read a block of bytes from the stream.
Reimplemented from ICSharpCode::SharpZipLib::Zip::Compression::Streams::InflaterInputStream. Definition at line 423 of file ZipInputStream.cs. |
|
Reads a byte from the current zip entry.
The deflated stream is corrupted. Definition at line 354 of file ZipInputStream.cs. |
|
Definition at line 262 of file ZipInputStream.cs. |
|
|
|
Definition at line 107 of file ZipInputStream.cs. |
|
Definition at line 108 of file ZipInputStream.cs. |
|
Definition at line 112 of file ZipInputStream.cs. |
|
The current reader this instance.
Definition at line 105 of file ZipInputStream.cs. |
|
Definition at line 111 of file ZipInputStream.cs. |
|
Definition at line 113 of file ZipInputStream.cs. |
|
Definition at line 110 of file ZipInputStream.cs. |
|
Returns 1 if there is an entry available Otherwise returns 0.
Reimplemented from ICSharpCode::SharpZipLib::Zip::Compression::Streams::InflaterInputStream. Definition at line 336 of file ZipInputStream.cs. |
|
Gets a value indicating if the entry can be decompressed. The entry can only be decompressed if the library supports the zip features required to extract it. See the ZipEntry::VersionZipEntry Version property for more details. Definition at line 145 of file ZipInputStream.cs. |
|
Optional password used for encryption when non-null.
Definition at line 128 of file ZipInputStream.cs. |