C# Class ICSharpCode.SharpZipLib.Zip.ZipInputStream

This is an InflaterInputStream that reads the files baseInputStream an zip archive one after another. It has a special method to get the zip entry of the next file. The zip entry contains information about the file name size, compressed size, Crc, etc. It includes support for Stored and Deflated entries.

Author of the original java version : Jochen Hoenicke
Inheritance: ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream
Afficher le fichier Open project: icsharpcode/SharpZipLib Class Usage Examples

Méthodes publiques

Méthode Description
CloseEntry ( ) : void

Closes the current zip entry and moves to the next one.

GetNextEntry ( ) : ZipEntry

Advances to the next entry in the archive

If the previous entry is still open CloseEntry is called.

Read ( byte buffer, int offset, int count ) : int

Read a block of bytes from the stream.

Zero bytes read means end of stream.

ReadByte ( ) : int

Reads a byte from the current zip entry.

ZipInputStream ( Stream baseInputStream ) : System

Creates a new Zip input stream, for reading a zip archive.

ZipInputStream ( Stream baseInputStream, int bufferSize ) : System

Creates a new Zip input stream, for reading a zip archive.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Closes the zip input stream

Private Methods

Méthode Description
BodyRead ( byte buffer, int offset, int count ) : int

Reads a block of bytes from the current zip entry.

CompleteCloseEntry ( bool testCrc ) : void

Complete cleanup as the final part of closing.

InitialRead ( byte destination, int offset, int count ) : int

Perform the initial read on an entry which may include reading encryption headers and setting up inflation.

ReadDataDescriptor ( ) : void

Read data descriptor at the end of compressed data.

ReadingNotAvailable ( byte destination, int offset, int count ) : int

Handle attempts to read by throwing an InvalidOperationException.

ReadingNotSupported ( byte destination, int offset, int count ) : int

Handle attempts to read from this entry by throwing an exception

Method Details

CloseEntry() public méthode

Closes the current zip entry and moves to the next one.
/// The stream is closed /// /// The Zip stream ends early ///
public CloseEntry ( ) : void
Résultat void

Dispose() protected méthode

Closes the zip input stream
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

GetNextEntry() public méthode

Advances to the next entry in the archive
If the previous entry is still open CloseEntry is called.
/// Input stream is closed /// /// Password is not set, password is invalid, compression method is invalid, /// version required to extract is not supported ///
public GetNextEntry ( ) : ZipEntry
Résultat ZipEntry

Read() public méthode

Read a block of bytes from the stream.
Zero bytes read means end of stream.
public Read ( byte buffer, int offset, int count ) : int
buffer byte The destination for the bytes.
offset int The index to start storing data.
count int The number of bytes to attempt to read.
Résultat int

ReadByte() public méthode

Reads a byte from the current zip entry.
public ReadByte ( ) : int
Résultat int

ZipInputStream() public méthode

Creates a new Zip input stream, for reading a zip archive.
public ZipInputStream ( Stream baseInputStream ) : System
baseInputStream Stream The underlying providing data.
Résultat System

ZipInputStream() public méthode

Creates a new Zip input stream, for reading a zip archive.
public ZipInputStream ( Stream baseInputStream, int bufferSize ) : System
baseInputStream Stream The underlying providing data.
bufferSize int Size of the buffer.
Résultat System