C# Класс ICSharpCode.SharpZipLib.Zip.ZipOutputStream

Наследование: ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
CloseEntry ( ) : void

Closes the current entry, updating header and footer information as required

Finish ( ) : void

Finishes the stream. This will write the central directory at the end of the zip file and flush the stream.

This is automatically called when the stream is closed.

GetLevel ( ) : int

Get the current deflater compression level

PutNextEntry ( ZipEntry entry ) : void

Starts a new Zip entry. It automatically closes the previous entry if present. All entry elements bar name are optional, but must be correct if present. If the compression method is stored and the output is not patchable the compression for that entry is automatically changed to deflate level 0

SetComment ( string comment ) : void

Set the zip file comment.

SetLevel ( int level ) : void

Sets the compression level. The new level will be activated immediately.

Write ( byte buffer, int offset, int count ) : void

Writes the given buffer to the current entry.

ZipOutputStream ( Stream baseOutputStream ) : System

Creates a new Zip output stream, writing a zip archive.

ZipOutputStream ( Stream baseOutputStream, int bufferSize ) : System

Creates a new Zip output stream, writing a zip archive.

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

Метод Описание
AddExtraDataAES ( ZipEntry entry, ZipExtraData extraData ) : void
CopyAndEncrypt ( byte buffer, int offset, int count ) : void
WriteAESHeader ( ZipEntry entry ) : void
WriteEncryptionHeader ( long crcValue ) : void
WriteLeInt ( int value ) : void

Write an int in little endian byte order.

WriteLeLong ( long value ) : void

Write an int in little endian byte order.

WriteLeShort ( int value ) : void

Write an unsigned short in little endian byte order.

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

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

Closes the current entry, updating header and footer information as required
/// An I/O error occurs. /// /// No entry is active. ///
public CloseEntry ( ) : void
Результат void

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

Finishes the stream. This will write the central directory at the end of the zip file and flush the stream.
This is automatically called when the stream is closed.
/// An I/O error occurs. /// /// Comment exceeds the maximum length
/// Entry name exceeds the maximum length ///
public Finish ( ) : void
Результат void

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

Get the current deflater compression level
public GetLevel ( ) : int
Результат int

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

Starts a new Zip entry. It automatically closes the previous entry if present. All entry elements bar name are optional, but must be correct if present. If the compression method is stored and the output is not patchable the compression for that entry is automatically changed to deflate level 0
/// if entry passed is null. /// /// if an I/O error occured. /// /// if stream was finished /// /// Too many entries in the Zip file
/// Entry name is too long
/// Finish has already been called
///
public PutNextEntry ( ZipEntry entry ) : void
entry ZipEntry /// the entry. ///
Результат void

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

Set the zip file comment.
/// The converted comment is longer than 0xffff bytes. ///
public SetComment ( string comment ) : void
comment string /// The comment text for the entire archive. ///
Результат void

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

Sets the compression level. The new level will be activated immediately.
/// Level specified is not supported. ///
public SetLevel ( int level ) : void
level int The new compression level (1 to 9).
Результат void

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

Writes the given buffer to the current entry.
Archive size is invalid No entry is active.
public Write ( byte buffer, int offset, int count ) : void
buffer byte The buffer containing data to write.
offset int The offset of the first byte to write.
count int The number of bytes to write.
Результат void

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

Creates a new Zip output stream, writing a zip archive.
public ZipOutputStream ( Stream baseOutputStream ) : System
baseOutputStream Stream /// The output stream to which the archive contents are written. ///
Результат System

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

Creates a new Zip output stream, writing a zip archive.
public ZipOutputStream ( Stream baseOutputStream, int bufferSize ) : System
baseOutputStream Stream The output stream to which the archive contents are written.
bufferSize int Size of the buffer to use.
Результат System