C# Класс 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
Наследование: ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Closes the zip input stream

Приватные методы

Метод Описание
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

Описание методов

CloseEntry() публичный Метод

Closes the current zip entry and moves to the next one.
/// The stream is closed /// /// The Zip stream ends early ///
public CloseEntry ( ) : void
Результат void

Dispose() защищенный Метод

Closes the zip input stream
protected Dispose ( bool disposing ) : void
disposing bool
Результат void

GetNextEntry() публичный Метод

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
Результат ZipEntry

Read() публичный Метод

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.
Результат int

ReadByte() публичный Метод

Reads a byte from the current zip entry.
public ReadByte ( ) : int
Результат int

ZipInputStream() публичный Метод

Creates a new Zip input stream, for reading a zip archive.
public ZipInputStream ( Stream baseInputStream ) : System
baseInputStream Stream The underlying providing data.
Результат System

ZipInputStream() публичный Метод

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.
Результат System