Skip to content

BasicUnpackStreamContext Class

Stream context used to extract a single file from an archive into a memory stream.

MethodDescription
CloseArchiveReadStream(archiveNumber, archiveName, stream)Does not close the stream. The archive stream should be managed by the code that invokes the archive extraction.
CloseFileWriteStream(path, stream, attributes, lastWriteTime)Does not close the file stream. The file stream is saved in memory so it can be read later.
OpenArchiveReadStream(archiveNumber, archiveName, compressionEngine)Opens the archive stream for reading. Returns a DuplicateStream instance, so the stream may be virtually opened multiple times.
OpenFileWriteStream(path, fileSize, lastWriteTime)Opens a stream for writing extracted file bytes. The returned stream is a MemoryStream instance, so the file is extracted straight into memory.
PropertyDescription
FileStreamGets the stream for the extracted file, or null if no file was extracted.
WixToolset.Dtf.Compression.dll version 5.0.0+41e11442b2ca93e444b60213b5ae99dcbab787d8

CloseArchiveReadStream(archiveNumber, archiveName, stream) Method

Section titled “CloseArchiveReadStream(archiveNumber, archiveName, stream) Method”

Does not close the stream. The archive stream should be managed by the code that invokes the archive extraction.

public void CloseArchiveReadStream(
int archiveNumber,
string archiveName,
System.IO.Stream stream
)
ParameterTypeDescription
archiveNumberintThe archive number of the stream to close.
archiveNamestringThe name of the archive being closed.
streamSystem.IO.StreamThe stream being closed.

CloseFileWriteStream(path, stream, attributes, lastWriteTime) Method

Section titled “CloseFileWriteStream(path, stream, attributes, lastWriteTime) Method”

Does not close the file stream. The file stream is saved in memory so it can be read later.

public void CloseFileWriteStream(
string path,
System.IO.Stream stream,
System.IO.FileAttributes attributes,
System.DateTime lastWriteTime
)
ParameterTypeDescription
pathstringPath of the file within the archive.
streamSystem.IO.StreamThe file stream to be closed.
attributesSystem.IO.FileAttributesThe attributes of the extracted file.
lastWriteTimeSystem.DateTimeThe last write time of the file.

OpenArchiveReadStream(archiveNumber, archiveName, compressionEngine) Method

Section titled “OpenArchiveReadStream(archiveNumber, archiveName, compressionEngine) Method”

Opens the archive stream for reading. Returns a DuplicateStream instance, so the stream may be virtually opened multiple times.

public System.IO.Stream OpenArchiveReadStream(
int archiveNumber,
string archiveName,
CompressionEngine compressionEngine
)
ParameterTypeDescription
archiveNumberintThe archive number to open (ignored; 0 is assumed).
archiveNamestringThe name of the archive being opened.
compressionEngineCompressionEngineInstance of the compression engine doing the operations.

System.IO.Stream A stream from which archive bytes are read.

OpenFileWriteStream(path, fileSize, lastWriteTime) Method

Section titled “OpenFileWriteStream(path, fileSize, lastWriteTime) Method”

Opens a stream for writing extracted file bytes. The returned stream is a MemoryStream instance, so the file is extracted straight into memory.

public System.IO.Stream OpenFileWriteStream(
string path,
System.Int64 fileSize,
System.DateTime lastWriteTime
)
ParameterTypeDescription
pathstringPath of the file within the archive.
fileSizeSystem.Int64The uncompressed size of the file to be extracted.
lastWriteTimeSystem.DateTimeThe last write time of the file.

System.IO.Stream A stream where extracted file bytes are to be written.

Gets the stream for the extracted file, or null if no file was extracted.

public System.IO.Stream FileStream { get; set; }