This is a DeflaterOutputStream that writes the files into a zip archive one after another. It has a special method to start a new zip entry. The zip entries contains information about the file name size, compressed size, CRC, etc.
More...
|
| | ZipOutputStream (Stream baseOutputStream) |
| | Creates a new Zip output stream, writing a zip archive.
|
| | ZipOutputStream (Stream baseOutputStream, int bufferSize) |
| | Creates a new Zip output stream, writing a zip archive.
|
| void | SetComment (string comment) |
| | Set the zip file comment.
|
| void | SetLevel (int level) |
| | Sets the compression level. The new level will be activated immediately.
|
| int | GetLevel () |
| | Get the current deflater compression level.
|
| void | PutNextEntry (ZipEntry entry) |
| | 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.
|
| void | CloseEntry () |
| | Closes the current entry, updating header and footer information as required.
|
| override void | Write (byte[] buffer, int offset, int count) |
| | Writes the given buffer to the current entry.
|
| override void | Finish () |
| | Finishes the stream. This will write the central directory at the end of the zip file and flush the stream.
|
| | DeflaterOutputStream (Stream baseOutputStream) |
| | Creates a new DeflaterOutputStream with a default Deflater and default buffer size.
|
| | DeflaterOutputStream (Stream baseOutputStream, Deflater deflater) |
| | Creates a new DeflaterOutputStream with the given Deflater and default buffer size.
|
| | DeflaterOutputStream (Stream baseOutputStream, Deflater deflater, int bufferSize) |
| | Creates a new DeflaterOutputStream with the given Deflater and buffer size.
|
| override long | Seek (long offset, SeekOrigin origin) |
| | Sets the current position of this stream to the given value. Not supported by this class!
|
| override void | SetLength (long value) |
| | Sets the length of this stream to the given value. Not supported by this class!
|
| override int | ReadByte () |
| | Read a byte from stream advancing position by one.
|
| override int | Read (byte[] buffer, int offset, int count) |
| | Read a block of bytes from stream.
|
| override IAsyncResult | BeginRead (byte[] buffer, int offset, int count, AsyncCallback callback, object state) |
| | Asynchronous reads are not supported a NotSupportedException is always thrown.
|
| override IAsyncResult | BeginWrite (byte[] buffer, int offset, int count, AsyncCallback callback, object state) |
| | Asynchronous writes arent supported, a NotSupportedException is always thrown.
|
| override void | Flush () |
| | Flushes the stream by calling Flush on the deflater and then on the underlying stream. This ensures that all bytes are flushed.
|
| override void | Close () |
| | Calls Finish and closes the underlying stream when IsStreamOwner is true.
|
| override void | WriteByte (byte value) |
| | Writes a single byte to the compressed output stream.
|
| override void | Write (byte[] buffer, int offset, int count) |
| | Writes bytes from an array to the compressed stream.
|
|
| bool | IsFinished [get] |
| | Gets a flag value of true if the central header has been added for this archive; false if it has not been added.
|
| UseZip64 | UseZip64 [get, set] |
| | Get / set a value indicating how Zip64 Extension usage is determined when adding entries.
|
| bool | IsStreamOwner [get, set] |
| | Get/set flag indicating ownership of the underlying stream. When the flag is true Close will close the underlying stream also.
|
| bool | CanPatchEntries [get] |
| | Allows client to determine if an entry can be patched after its added.
|
| string | Password [get, set] |
| | Get/set the password used for encryption.
|
| override bool | CanRead [get] |
| | Gets value indicating stream can be read from.
|
| override bool | CanSeek [get] |
| | Gets a value indicating if seeking is supported for this stream This property always returns false.
|
| override bool | CanWrite [get] |
| | Get value indicating if this stream supports writing.
|
| override long | Length [get] |
| | Get current length of stream.
|
| override long | Position [get, set] |
| | Gets the current position within the stream.
|
|
| void | EncryptBlock (byte[] buffer, int offset, int length) |
| | Encrypt a block of data.
|
| void | InitializePassword (string password) |
| | Initializes encryption keys based on given password .
|
| void | InitializeAESPassword (ZipEntry entry, string rawPassword, out byte[] salt, out byte[] pwdVerifier) |
| | Initializes encryption keys based on given password.
|
| void | Deflate () |
| | Deflates everything in the input buffers. This will call.
|
| byte[] | AESAuthCode |
| | Returns the 10 byte AUTH CODE to be appended immediately following the AES data stream.
|
| Deflater | deflater_ |
| | The deflater which is used to deflate the stream.
|
| Stream | baseOutputStream_ |
| | Base stream the deflater depends on.
|
This is a DeflaterOutputStream that writes the files into a zip archive one after another. It has a special method to start a new zip entry. The zip entries contains information about the file name size, compressed size, CRC, etc.
It includes support for Stored and Deflated entries. This class is not thread safe.
Author of the original java version : Jochen Hoenicke
This sample shows how to create a zip file
using System;
using System.IO;
class MainClass
{
public static void Main(string[] args)
{
string[] filenames = Directory.GetFiles(args[0]);
byte[] buffer = new byte[4096];
@iverbatim
foreach (string file in filenames) {
using (FileStream fs =
File.OpenRead(file)) {
}
}
@endiverbatim }
}
} <br>
Zwipe.Test.Tools.Entities.File File
Definition ExportsTest.cs:6
Provides simple Stream" utilities.
Definition StreamUtils.cs:45
static void Copy(Stream source, Stream destination, byte[] buffer)
Copy the contents of one Stream to another.
Definition StreamUtils.cs:102
This class represents an entry in a zip archive. This can be a file or a directory ZipFile and ZipInp...
Definition ZipEntry.cs:151
ZipOutputStream(Stream baseOutputStream)
Creates a new Zip output stream, writing a zip archive.
Definition ZipOutputStream.cs:106
void PutNextEntry(ZipEntry entry)
Starts a new Zip entry. It automatically closes the previous entry if present. All entry elements bar...
Definition ZipOutputStream.cs:246
void SetLevel(int level)
Sets the compression level. The new level will be activated immediately.
Definition ZipOutputStream.cs:161
Definition FileSystemScanner.cs:40
Definition Deflater.cs:43