C# Class ICSharpCode.SharpZipLib.Zip.ZipOutputStream

Inheritance: ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream
Afficher le fichier Open project: icsharpcode/SharpZipLib Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

CloseEntry() public méthode

Closes the current entry, updating header and footer information as required
/// An I/O error occurs. /// /// No entry is active. ///
public CloseEntry ( ) : void
Résultat void

Finish() public méthode

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
Résultat void

GetLevel() public méthode

Get the current deflater compression level
public GetLevel ( ) : int
Résultat int

PutNextEntry() public méthode

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. ///
Résultat void

SetComment() public méthode

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. ///
Résultat void

SetLevel() public méthode

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).
Résultat void

Write() public méthode

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.
Résultat void

ZipOutputStream() public méthode

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. ///
Résultat System

ZipOutputStream() public méthode

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.
Résultat System