Skip to main content

BasicUnpackStreamContext Class

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

Methods

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.

Properties

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

WixToolset.Dtf.Compression.dll version 5.0.2+aa65968c419420d32e3e1b647aea0082f5ca5b78

CloseArchiveReadStream(archiveNumber, archiveName, stream) Method

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

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 being closed.

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.

Declaration

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

Parameters

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

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

Declaration

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

Parameters

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.

Return value

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

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.

Declaration

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

Parameters

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.

Return value

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

FileStream Property

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

Declaration

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