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

ExceptionCondition
System..::..ArgumentNullExceptioninputStream is null.
System..::..ArgumentExceptionarchiveFilePath is empty or contains invalid characters.
System..::..InvalidOperationExceptionArchive is not opened for writing. -or- inputStream refers to the ZIP archive itself.
System..::..ObjectDisposedExceptionArchive was already disposed.
System.IO..::..PathTooLongExceptionarchiveFilePath is longer than 65.535 characters.
System.IO..::..IOExceptionAn I/O error occurred.
Rebex.IO.Compression..::..ZipExceptionCannot perform the requested operation, or the operation was canceled (see ProblemType for detailed information).

Version Information

.NET Compact Framework

Supported in: 3.9, 3.5

See Also