C# Class ICSharpCode.SharpZipLib.Zip.ZipOutputStream

Inheritance: ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream
ファイルを表示 Open project: icsharpcode/SharpZipLib Class Usage Examples

Public Methods

Method 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

Method 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 method

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

Finish() public method

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
return void

GetLevel() public method

Get the current deflater compression level
public GetLevel ( ) : int
return int

PutNextEntry() public method

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. ///
return void

SetComment() public method

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. ///
return void

SetLevel() public method

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).
return void

Write() public method

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.
return void

ZipOutputStream() public method

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. ///
return System

ZipOutputStream() public method

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.
return System