Adds data from the specified stream to the ZIP archive.
Namespace:
Rebex.IO.Compression
Assembly:
Rebex.Zip (in Rebex.Zip.dll)
Syntax
Visual Basic |
---|
Public Function AddFile ( _ inputStream As Stream, _ archiveFilePath As String _ ) As ArchiveOperationResult |
C# |
---|
public ArchiveOperationResult AddFile( Stream inputStream, string archiveFilePath ) |
Parameters
- inputStream
- Type: System.IO..::..Stream
Stream to read the data from.
- archiveFilePath
- Type: System..::..String
Absolute path to a (non-existing) file item within the ZIP archive.
Return Value
Operation result.Remarks
Note that only data following the current position of the input stream is compressed.
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | inputStream is null. |
System..::..ArgumentException | archiveFilePath is empty or contains invalid characters. |
System..::..InvalidOperationException | Archive is not opened for writing. -or- inputStream refers to the ZIP archive itself. |
System..::..ObjectDisposedException | Archive was already disposed. |
System.IO..::..PathTooLongException | archiveFilePath is longer than 65.535 characters. |
System.IO..::..IOException | An I/O error occurred. |
Rebex.IO.Compression..::..ZipException | Cannot perform the requested operation, or the operation was canceled (see ProblemType for detailed information). |