Skip to main content

IUnpackStreamContext Interface

This interface provides the methods necessary for the «see T:WixToolset.Dtf.Compression.CompressionEngine» to open and close streams for archives and files. The implementor of this interface can use any kind of logic to determine what kind of streams to open and where

Methods

MethodDescription
CloseArchiveReadStream(archiveNumber, archiveName, stream)Closes a stream where an archive package was read.
CloseFileWriteStream(path, stream, attributes, lastWriteTime)Closes a stream where an extracted file was written.
OpenArchiveReadStream(archiveNumber, archiveName, compressionEngine)Opens the archive stream for reading.
OpenFileWriteStream(path, fileSize, lastWriteTime)Opens a stream for writing extracted file bytes.

WixToolset.Dtf.Compression.dll version 5.0.0-rc.2+dbb148c20d2490cf85f3f62f7d59f8dbc5c1a2c5

CloseArchiveReadStream(archiveNumber, archiveName, stream) Method

Closes a stream where an archive package was read.

Declaration

public void CloseArchiveReadStream(
int archiveNumber,
string archiveName,
System.IO.Stream stream
)

Parameters

ParameterTypeDescription
archiveNumberintThe archive number of the stream to close.
archiveNamestringThe name of the archive being closed.
streamSystem.IO.StreamThe stream that was previously returned by and is now ready to be closed.

CloseFileWriteStream(path, stream, attributes, lastWriteTime) Method

Closes a stream where an extracted file was written.

Declaration

public void CloseFileWriteStream(
string path,
System.IO.Stream stream,
System.IO.FileAttributes attributes,
System.DateTime lastWriteTime
)

Parameters

ParameterTypeDescription
pathstringThe path of the file within the archive.
streamSystem.IO.StreamThe stream that was previously returned by and is now ready to be closed.
attributesSystem.IO.FileAttributesThe attributes of the extracted file.
lastWriteTimeSystem.DateTimeThe last write time of the file.

Remarks

The implementor may wish to apply the attributes and date to the newly-extracted file.

OpenArchiveReadStream(archiveNumber, archiveName, compressionEngine) Method

Opens the archive stream for reading.

Declaration

public System.IO.Stream OpenArchiveReadStream(
int archiveNumber,
string archiveName,
CompressionEngine compressionEngine
)

Parameters

ParameterTypeDescription
archiveNumberintThe zero-based index of the archive to open.
archiveNamestringThe name of the archive being opened.
compressionEngineCompressionEngineInstance of the compression engine doing the operations.

Return value

System.IO.Stream A stream from which archive bytes are read, or null to cancel extraction of the archive.

Remarks

When the first archive in a chain is opened, the name is not yet known, so the provided value will be an empty string. When opening further archives, the provided value is the next-archive name stored in the previous archive. This name is often, but not necessarily, the same as the filename of the archive package to be opened.If this method returns null, the archive engine will throw a FileNotFoundException.

OpenFileWriteStream(path, fileSize, lastWriteTime) Method

Opens a stream for writing extracted file bytes.

Declaration

public System.IO.Stream OpenFileWriteStream(
string path,
System.Int64 fileSize,
System.DateTime lastWriteTime
)

Parameters

ParameterTypeDescription
pathstringThe path of the file within the archive. This is often, but not necessarily, the same as the relative path of the file outside the archive.
fileSizeSystem.Int64The uncompressed size of the file to be extracted.
lastWriteTimeSystem.DateTimeThe last write time of the file to be extracted.

Return value

System.IO.Stream A stream where extracted file bytes are to be written, or null to skip extraction of the file and continue to the next file.

Remarks

The implementor may use the path, size and date information to dynamically decide whether or not the file should be extracted.