|
Fingerprint_Card
|
This class represents a Zip archive. You can ask for the contained entries, or get an input stream for a file entry. The entry is automatically decompressed. More...


Classes | |
| class | PartialInputStream |
| A PartialInputStream is an InflaterInputStream whose data is only a part or subsection of a file. More... | |
| class | UncompressedStream |
| An UncompressedStream is a stream that you can write uncompressed data to and flush, but cannot read, seek or do anything else to. More... | |
| class | UpdateComparer |
| Class used to sort updates. More... | |
| class | ZipEntryEnumerator |
| An enumerator for Zip entries More... | |
| class | ZipString |
| Represents a string from a ZipFile which is stored as an array of bytes. More... | |
| class | ZipUpdate |
| Represents a pending update to a Zip file. More... | |
Public Member Functions | |
| delegate void | KeysRequiredEventHandler (object sender, KeysRequiredEventArgs e) |
| Delegate for handling keys/password setting during compresion/decompression. | |
| ZipFile (string name) | |
| Opens a Zip file with the given name for reading. | |
| ZipFile (FileStream file) | |
| Opens a Zip file reading the given FileStream. | |
| ZipFile (Stream stream) | |
| Opens a Zip file reading the given Stream. | |
| void | Close () |
| Closes the ZipFile. If the stream is owned then this also closes the underlying input stream. Once closed, no further instance methods should be called. | |
| IEnumerator | GetEnumerator () |
| Gets an enumerator for the Zip entries in this Zip file. | |
| int | FindEntry (string name, bool ignoreCase) |
| Return the index of the entry with a matching name. | |
| ZipEntry | GetEntry (string name) |
| Searches for a zip entry in this archive with the given name. String comparisons are case insensitive. | |
| Stream | GetInputStream (ZipEntry entry) |
| Gets an input stream for reading the given zip entry data in an uncompressed form. Normally the ZipEntry should be an entry returned by GetEntry(). | |
| Stream | GetInputStream (long entryIndex) |
| Creates an input stream reading a zip entry. | |
| bool | TestArchive (bool testData) |
| Test an archive for integrity/validity. | |
| bool | TestArchive (bool testData, TestStrategy strategy, ZipTestResultHandler resultHandler) |
| Test an archive for integrity/validity. | |
| void | BeginUpdate (IArchiveStorage archiveStorage, IDynamicDataSource dataSource) |
| Begin updating this ZipFile archive. | |
| void | BeginUpdate (IArchiveStorage archiveStorage) |
| Begin updating to this ZipFile archive. | |
| void | BeginUpdate () |
| Begin updating this ZipFile archive. | |
| void | CommitUpdate () |
| Commit current updates, updating this archive. | |
| void | AbortUpdate () |
| Abort updating leaving the archive unchanged. | |
| void | SetComment (string comment) |
| Set the file comment to be recorded when the current update is commited. | |
| void | Add (string fileName, CompressionMethod compressionMethod, bool useUnicodeText) |
| Add a new entry to the archive. | |
| void | Add (string fileName, CompressionMethod compressionMethod) |
| Add a new entry to the archive. | |
| void | Add (string fileName) |
| Add a file to the archive. | |
| void | Add (string fileName, string entryName) |
| Add a file to the archive. | |
| void | Add (IStaticDataSource dataSource, string entryName) |
| Add a file entry with data. | |
| void | Add (IStaticDataSource dataSource, string entryName, CompressionMethod compressionMethod) |
| Add a file entry with data. | |
| void | Add (IStaticDataSource dataSource, string entryName, CompressionMethod compressionMethod, bool useUnicodeText) |
| Add a file entry with data. | |
| void | Add (ZipEntry entry) |
| Add a ZipEntry that contains no data. | |
| void | AddDirectory (string directoryName) |
| Add a directory entry to the archive. | |
| bool | Delete (string fileName) |
| Delete an entry by name. | |
| void | Delete (ZipEntry entry) |
| Delete a ZipEntry from the archive. | |
Static Public Member Functions | |
| static ZipFile | Create (string fileName) |
| Create a new ZipFile whose data will be stored in a file. | |
| static ZipFile | Create (Stream outStream) |
| Create a new ZipFile whose data will be stored on a stream. | |
Public Attributes | |
| KeysRequiredEventHandler | KeysRequired |
| Event handler for handling encryption keys. | |
Protected Member Functions | |
| virtual void | Dispose (bool disposing) |
| Releases the unmanaged resources used by the this instance and optionally releases the managed resources. | |
Package Functions | |
| ZipFile () | |
| Initialises a default ZipFile instance with no entries and no file storage. | |
Properties | |
| byte[] | Key [get, set] |
| Get/set the encryption key value. | |
| string | Password [set] |
| Password to be used for encrypting/decrypting files. | |
| bool | HaveKeys [get] |
| Get a value indicating wether encryption keys are currently available. | |
| bool | IsStreamOwner [get, set] |
| Get/set a flag indicating if the underlying stream is owned by the ZipFile instance. If the flag is true then the stream will be closed when Close is called. | |
| bool | IsEmbeddedArchive [get] |
| Get a value indicating wether this archive is embedded in another file or not. | |
| bool | IsNewArchive [get] |
| Get a value indicating that this archive is a new one. | |
| string | ZipFileComment [get] |
| Gets the comment for the zip file. | |
| string | Name [get] |
| Gets the name of this zip file. | |
| int | Size [get] |
| Gets the number of entries in this zip file. | |
| long | Count [get] |
| Get the number of entries contained in this ZipFile. | |
| ZipEntry | this[int index] [get] |
| Indexer property for ZipEntries. | |
| INameTransform | NameTransform [get, set] |
| Get / set the INameTransform to apply to names when updating. | |
| IEntryFactory | EntryFactory [get, set] |
| Get/set the IEntryFactory used to generate ZipEntry values during updates. | |
| int | BufferSize [get, set] |
| Get /set the buffer size to be used when updating this zip file. | |
| bool | IsUpdating [get] |
| Get a value indicating an update has been started. | |
| UseZip64 | UseZip64 [get, set] |
| Get / set a value indicating how Zip64 Extension usage is determined when adding entries. | |
Private Types | |
| enum | HeaderTest { Extract = 0x01 , Header = 0x02 } |
| enum | UpdateCommand { Copy , Modify , Add } |
| The kind of update to apply. More... | |
Private Member Functions | |
| void | OnKeysRequired (string fileName) |
| Handles getting of encryption keys when required. | |
| ~ZipFile () | |
| Finalize this instance. | |
| long | TestLocalHeader (ZipEntry entry, HeaderTest tests) |
| Test a local header against that provided from the central directory. | |
| void | AddUpdate (ZipUpdate update) |
| void | WriteLEShort (int value) |
| void | WriteLEUshort (ushort value) |
| Write an unsigned short in little endian byte order. | |
| void | WriteLEInt (int value) |
| Write an int in little endian byte order. | |
| void | WriteLEUint (uint value) |
| Write an unsigned int in little endian byte order. | |
| void | WriteLeLong (long value) |
| Write a long in little endian byte order. | |
| void | WriteLEUlong (ulong value) |
| void | WriteLocalEntryHeader (ZipUpdate update) |
| int | WriteCentralDirectoryHeader (ZipEntry entry) |
| void | PostUpdateCleanup () |
| string | GetTransformedFileName (string name) |
| string | GetTransformedDirectoryName (string name) |
| byte[] | GetBuffer () |
| Get a raw memory buffer. | |
| void | CopyDescriptorBytes (ZipUpdate update, Stream dest, Stream source) |
| void | CopyBytes (ZipUpdate update, Stream destination, Stream source, long bytesToCopy, bool updateCrc) |
| int | GetDescriptorSize (ZipUpdate update) |
| Get the size of the source descriptor for a ZipUpdate. | |
| void | CopyDescriptorBytesDirect (ZipUpdate update, Stream stream, ref long destinationPosition, long sourcePosition) |
| void | CopyEntryDataDirect (ZipUpdate update, Stream stream, bool updateCrc, ref long destinationPosition, ref long sourcePosition) |
| int | FindExistingUpdate (ZipEntry entry) |
| int | FindExistingUpdate (string fileName) |
| Stream | GetOutputStream (ZipEntry entry) |
| Get an output stream for the specified ZipEntry | |
| void | AddEntry (ZipFile workFile, ZipUpdate update) |
| void | ModifyEntry (ZipFile workFile, ZipUpdate update) |
| void | CopyEntryDirect (ZipFile workFile, ZipUpdate update, ref long destinationPosition) |
| void | CopyEntry (ZipFile workFile, ZipUpdate update) |
| void | Reopen (Stream source) |
| void | Reopen () |
| void | UpdateCommentOnly () |
| void | RunUpdates () |
| void | CheckUpdating () |
| void IDisposable. | Dispose () |
| void | DisposeInternal (bool disposing) |
| ushort | ReadLEUshort () |
| Read an unsigned short in little endian byte order. | |
| uint | ReadLEUint () |
| Read a uint in little endian byte order. | |
| ulong | ReadLEUlong () |
| long | LocateBlockWithSignature (int signature, long endLocation, int minimumBlockSize, int maximumVariableData) |
| void | ReadEntries () |
| Search for and read the central directory of a zip file filling the entries array. | |
| long | LocateEntry (ZipEntry entry) |
| Locate the data for a given entry. | |
| Stream | CreateAndInitDecryptionStream (Stream baseStream, ZipEntry entry) |
| Stream | CreateAndInitEncryptionStream (Stream baseStream, ZipEntry entry) |
Static Private Member Functions | |
| static void | CheckClassicPassword (CryptoStream classicCryptoStream, ZipEntry entry) |
| static void | WriteEncryptionHeader (Stream stream, long crcValue) |
Private Attributes | |
| bool | isDisposed_ |
| string | name_ |
| string | comment_ |
| string | rawPassword_ |
| Stream | baseStream_ |
| bool | isStreamOwner |
| long | offsetOfFirstEntry |
| ZipEntry[] | entries_ |
| byte[] | key |
| bool | isNewArchive_ |
| UseZip64 | useZip64_ = UseZip64.Dynamic |
| ArrayList | updates_ |
| long | updateCount_ |
| Hashtable | updateIndex_ |
| IArchiveStorage | archiveStorage_ |
| IDynamicDataSource | updateDataSource_ |
| bool | contentsEdited_ |
| int | bufferSize_ = DefaultBufferSize |
| byte[] | copyBuffer_ |
| ZipString | newComment_ |
| bool | commentEdited_ |
| IEntryFactory | updateEntryFactory_ = new ZipEntryFactory() |
Static Private Attributes | |
| const int | DefaultBufferSize = 4096 |
This class represents a Zip archive. You can ask for the contained entries, or get an input stream for a file entry. The entry is automatically decompressed.
You can also update the archive adding or deleting entries.
This class is thread safe for input: You can open input streams for arbitrary entries in different threads.
Author of the original java version : Jochen Hoenicke
|
private |
|
private |
| ICSharpCode.SharpZipLib.Zip.ZipFile.ZipFile | ( | string | name | ) |
Opens a Zip file with the given name for reading.
| name | The name of the file to open. |
| ArgumentNullException | The argument supplied is null. |
| IOException | An i/o error occurs |
| ZipException | The file doesn't contain a valid zip archive. |


| ICSharpCode.SharpZipLib.Zip.ZipFile.ZipFile | ( | FileStream | file | ) |
Opens a Zip file reading the given FileStream.
| file | The FileStream to read archive data from. |
| ArgumentNullException | The supplied argument is null. |
| IOException | An i/o error occurs. |
| ZipException | The file doesn't contain a valid zip archive. |

| ICSharpCode.SharpZipLib.Zip.ZipFile.ZipFile | ( | Stream | stream | ) |
Opens a Zip file reading the given Stream.
| stream | The Stream to read archive data from. |
| IOException | An i/o error occurs |
| ZipException | The stream doesn't contain a valid zip archive. |
| ArgumentException | The stream doesnt support seeking. |
| ArgumentNullException | The stream argument is null. |

|
package |
Initialises a default ZipFile instance with no entries and no file storage.

|
private |
Finalize this instance.

| void ICSharpCode.SharpZipLib.Zip.ZipFile.AbortUpdate | ( | ) |
Abort updating leaving the archive unchanged.

| void ICSharpCode.SharpZipLib.Zip.ZipFile.Add | ( | IStaticDataSource | dataSource, |
| string | entryName ) |
Add a file entry with data.
| dataSource | The source of the data for this entry. |
| entryName | The name to give to the entry. |

| void ICSharpCode.SharpZipLib.Zip.ZipFile.Add | ( | IStaticDataSource | dataSource, |
| string | entryName, | ||
| CompressionMethod | compressionMethod ) |
Add a file entry with data.
| dataSource | The source of the data for this entry. |
| entryName | The name to give to the entry. |
| compressionMethod | The compression method to use. |

| void ICSharpCode.SharpZipLib.Zip.ZipFile.Add | ( | IStaticDataSource | dataSource, |
| string | entryName, | ||
| CompressionMethod | compressionMethod, | ||
| bool | useUnicodeText ) |
Add a file entry with data.
| dataSource | The source of the data for this entry. |
| entryName | The name to give to the entry. |
| compressionMethod | The compression method to use. |
| useUnicodeText | Ensure Unicode text is used for name and comments for this entry. |

| void ICSharpCode.SharpZipLib.Zip.ZipFile.Add | ( | string | fileName | ) |
Add a file to the archive.
| fileName | The name of the file to add. |
| ArgumentNullException | Argument supplied is null. |

| void ICSharpCode.SharpZipLib.Zip.ZipFile.Add | ( | string | fileName, |
| CompressionMethod | compressionMethod ) |
Add a new entry to the archive.
| fileName | The name of the file to add. |
| compressionMethod | The compression method to use. |
| ArgumentNullException | ZipFile has been closed. |
| ArgumentOutOfRangeException | The compression method is not supported. |

| void ICSharpCode.SharpZipLib.Zip.ZipFile.Add | ( | string | fileName, |
| CompressionMethod | compressionMethod, | ||
| bool | useUnicodeText ) |
Add a new entry to the archive.
| fileName | The name of the file to add. |
| compressionMethod | The compression method to use. |
| useUnicodeText | Ensure Unicode text is used for name and comment for this entry. |
| ArgumentNullException | Argument supplied is null. |
| ObjectDisposedException | ZipFile has been closed. |
| ArgumentOutOfRangeException | Compression method is not supported. |

| void ICSharpCode.SharpZipLib.Zip.ZipFile.Add | ( | string | fileName, |
| string | entryName ) |
| void ICSharpCode.SharpZipLib.Zip.ZipFile.Add | ( | ZipEntry | entry | ) |
Add a ZipEntry that contains no data.
| entry | The entry to add. |
This can be used to add directories, volume labels, or empty file entries.

| void ICSharpCode.SharpZipLib.Zip.ZipFile.AddDirectory | ( | string | directoryName | ) |
Add a directory entry to the archive.
| directoryName | The directory to add. |



|
private |


| void ICSharpCode.SharpZipLib.Zip.ZipFile.BeginUpdate | ( | ) |
Begin updating this ZipFile archive.


| void ICSharpCode.SharpZipLib.Zip.ZipFile.BeginUpdate | ( | IArchiveStorage | archiveStorage | ) |
Begin updating to this ZipFile archive.
| archiveStorage | The storage to use during the update. |

| void ICSharpCode.SharpZipLib.Zip.ZipFile.BeginUpdate | ( | IArchiveStorage | archiveStorage, |
| IDynamicDataSource | dataSource ) |
Begin updating this ZipFile archive.
| archiveStorage | The archive storage for use during the update. |
| dataSource | The data source to utilise during updating. |
|
staticprivate |


|
private |

| void ICSharpCode.SharpZipLib.Zip.ZipFile.Close | ( | ) |
| void ICSharpCode.SharpZipLib.Zip.ZipFile.CommitUpdate | ( | ) |
Commit current updates, updating this archive.
| ObjectDisposedException | ZipFile has been closed. |

|
private |


|
private |


|
private |




|
private |


|
private |


|
static |
|
static |
|
private |


|
private |


| bool ICSharpCode.SharpZipLib.Zip.ZipFile.Delete | ( | string | fileName | ) |
Delete an entry by name.
| fileName | The filename to delete |

| void ICSharpCode.SharpZipLib.Zip.ZipFile.Delete | ( | ZipEntry | entry | ) |
Delete a ZipEntry from the archive.
| entry | The entry to delete. |

|
private |


|
protectedvirtual |
Releases the unmanaged resources used by the this instance and optionally releases the managed resources.
| disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |

|
private |


| int ICSharpCode.SharpZipLib.Zip.ZipFile.FindEntry | ( | string | name, |
| bool | ignoreCase ) |
Return the index of the entry with a matching name.
| name | Entry name to find |
| ignoreCase | If true the comparison is case insensitive |
| ObjectDisposedException | The Zip file has been closed. |

|
private |

|
private |


|
private |
Get a raw memory buffer.

|
private |
Get the size of the source descriptor for a ZipUpdate.
| update | The update to get the size for. |

| ZipEntry ICSharpCode.SharpZipLib.Zip.ZipFile.GetEntry | ( | string | name | ) |
Searches for a zip entry in this archive with the given name. String comparisons are case insensitive.
| name | The name to find. May contain directory components separated by slashes ('/'). |
| ObjectDisposedException | The Zip file has been closed. |

| IEnumerator ICSharpCode.SharpZipLib.Zip.ZipFile.GetEnumerator | ( | ) |
| Stream ICSharpCode.SharpZipLib.Zip.ZipFile.GetInputStream | ( | long | entryIndex | ) |
Creates an input stream reading a zip entry.
| entryIndex | The index of the entry to obtain an input stream for. |
| ObjectDisposedException | The ZipFile has already been closed |
| ICSharpCode.SharpZipLib.Zip.ZipException | The compression method for the entry is unknown |
| IndexOutOfRangeException | The entry is not found in the ZipFile |

| Stream ICSharpCode.SharpZipLib.Zip.ZipFile.GetInputStream | ( | ZipEntry | entry | ) |
Gets an input stream for reading the given zip entry data in an uncompressed form. Normally the ZipEntry should be an entry returned by GetEntry().
| entry | The ZipEntry to obtain a data Stream for |
| ObjectDisposedException | The ZipFile has already been closed |
| ICSharpCode.SharpZipLib.Zip.ZipException | The compression method for the entry is unknown |
| IndexOutOfRangeException | The entry is not found in the ZipFile |


|
private |
Get an output stream for the specified ZipEntry
| entry | The entry to get an output stream for. |


|
private |

|
private |


| delegate void ICSharpCode.SharpZipLib.Zip.ZipFile.KeysRequiredEventHandler | ( | object | sender, |
| KeysRequiredEventArgs | e ) |
Delegate for handling keys/password setting during compresion/decompression.
|
private |


|
private |
Locate the data for a given entry.
| System.IO.EndOfStreamException | The stream ends prematurely |
| ICSharpCode.SharpZipLib.Zip.ZipException | The local header signature is invalid, the entry and central header file name lengths are different or the local and entry compression methods dont match |




|
private |
Handles getting of encryption keys when required.
| fileName | The file for which encryption keys are required. |

|
private |

|
private |
Search for and read the central directory of a zip file filling the entries array.
| System.IO.IOException | An i/o error occurs. |
| ICSharpCode.SharpZipLib.Zip.ZipException | The central directory is malformed or cannot be found |


|
private |
Read a uint in little endian byte order.
| IOException | An i/o error occurs. |
| System.IO.EndOfStreamException | The file ends prematurely |


|
private |


|
private |
Read an unsigned short in little endian byte order.
| EndOfStreamException | The stream ends prematurely |

|
private |


|
private |

|
private |


| void ICSharpCode.SharpZipLib.Zip.ZipFile.SetComment | ( | string | comment | ) |
| bool ICSharpCode.SharpZipLib.Zip.ZipFile.TestArchive | ( | bool | testData | ) |
Test an archive for integrity/validity.
| testData | Perform low level data Crc check |
Testing will terminate on the first error found.


| bool ICSharpCode.SharpZipLib.Zip.ZipFile.TestArchive | ( | bool | testData, |
| TestStrategy | strategy, | ||
| ZipTestResultHandler | resultHandler ) |
Test an archive for integrity/validity.
| testData | Perform low level data Crc check |
| strategy | The TestStrategy to apply. |
| resultHandler | The ZipTestResultHandler handler to call during testing. |
| ObjectDisposedException | The object has already been closed. |

|
private |
Test a local header against that provided from the central directory.
| entry | The entry to test against |
| tests | The type of tests to carry out. |


|
private |


|
private |


|
staticprivate |

|
private |
Write an int in little endian byte order.


|
private |
Write a long in little endian byte order.


|
private |

|
private |
Write an unsigned int in little endian byte order.


|
private |

|
private |
Write an unsigned short in little endian byte order.

|
private |


|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
| KeysRequiredEventHandler ICSharpCode.SharpZipLib.Zip.ZipFile.KeysRequired |
Event handler for handling encryption keys.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
getset |
Get /set the buffer size to be used when updating this zip file.
|
get |
Get the number of entries contained in this ZipFile.
|
getset |
Get/set the IEntryFactory used to generate ZipEntry values during updates.
|
getprivate |
Get a value indicating wether encryption keys are currently available.
|
get |
Get a value indicating wether this archive is embedded in another file or not.
|
get |
Get a value indicating that this archive is a new one.
|
getset |
|
get |
Get a value indicating an update has been started.
|
getsetprivate |
Get/set the encryption key value.
|
get |
Gets the name of this zip file.
|
getset |
Get / set the INameTransform to apply to names when updating.
|
set |
Password to be used for encrypting/decrypting files.
Set to null if no password is required.
|
get |
Gets the number of entries in this zip file.
| InvalidOperationException | The Zip file has been closed. |
|
get |
Indexer property for ZipEntries.
|
getset |
Get / set a value indicating how Zip64 Extension usage is determined when adding entries.
|
get |
Gets the comment for the zip file.