Microsoft.Deployment.Compression Base exception class for compression operations. Compression libraries should derive subclass exceptions with more specific error information relevent to the file format. Creates a new ArchiveException with a specified error message and a reference to the inner exception that is the cause of this exception. The message that describes the error. The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. Creates a new ArchiveException with a specified error message. The message that describes the error. Creates a new ArchiveException. Initializes a new instance of the ArchiveException class with serialized data. The SerializationInfo that holds the serialized object data about the exception being thrown. The StreamingContext that contains contextual information about the source or destination. Abstract object representing a compressed file within an archive; provides operations for getting the file properties and unpacking the file. Creates a new ArchiveFileInfo object representing a file within an archive in a specified path. An object representing the archive containing the file. The path to the file within the archive. Usually, this is a simple file name, but if the archive contains a directory structure this may include the directory. Creates a new ArchiveFileInfo object with all parameters specified; used by subclasses when reading the metadata out of an archive. The internal path and name of the file in the archive. The archive number where the file starts. The stored attributes of the file. The stored last write time of the file. The uncompressed size of the file. Initializes a new instance of the ArchiveFileInfo class with serialized data. The SerializationInfo that holds the serialized object data about the exception being thrown. The StreamingContext that contains contextual information about the source or destination. Gets the name of the file. The name of the file, not including any path. Gets the internal path of the file in the archive. The internal path of the file in the archive, not including the file name. Gets the full path to the file. The full path to the file, including the full path to the archive, the internal path in the archive, and the file name. For example, the path "C:\archive.cab\file.txt" refers to a file "file.txt" inside the archive "archive.cab". Gets or sets the archive that contains this file. The ArchiveInfo instance that retrieved this file information -- this may be null if the ArchiveFileInfo object was returned directly from a stream. Gets the full path of the archive that contains this file. The full path of the archive that contains this file. Gets the number of the archive where this file starts. The number of the archive where this file starts. A single archive or the first archive in a chain is numbered 0. Checks if the file exists within the archive. True if the file exists, false otherwise. Gets the uncompressed size of the file. The uncompressed size of the file in bytes. Gets the attributes of the file. The attributes of the file as stored in the archive. Gets the last modification time of the file. The last modification time of the file as stored in the archive. Sets the SerializationInfo with information about the archive. The SerializationInfo that holds the serialized object data. The StreamingContext that contains contextual information about the source or destination. Gets the full path to the file. The same as Deletes the file. NOT SUPPORTED. Files cannot be deleted from an existing archive. Refreshes the attributes and other cached information about the file, by re-reading the information from the archive. Extracts the file. The destination path where the file will be extracted. Extracts the file, optionally overwriting any existing file. The destination path where the file will be extracted. If true, will be overwritten if it exists. is false and exists. Opens the archive file for reading without actually extracting the file to disk. A stream for reading directly from the packed file. Like any stream this should be closed/disposed as soon as it is no longer needed. Opens the archive file reading text with UTF-8 encoding without actually extracting the file to disk. A reader for reading text directly from the packed file. Like any reader this should be closed/disposed as soon as it is no longer needed. To open an archived text file with different encoding, use the method and pass the returned stream to one of the constructor overloads. Refreshes the information in this object with new data retrieved from an archive. Fresh instance for the same file just read from the archive. Subclasses may override this method to refresh sublcass fields. However they should always call the base implementation first. Abstract object representing a compressed archive on disk; provides access to file-based operations on the archive. Creates a new ArchiveInfo object representing an archive in a specified path. The path to the archive. When creating an archive, this file does not necessarily exist yet. Initializes a new instance of the ArchiveInfo class with serialized data. The SerializationInfo that holds the serialized object data about the exception being thrown. The StreamingContext that contains contextual information about the source or destination. Gets the directory that contains the archive. A DirectoryInfo object representing the parent directory of the archive. Gets the full path of the directory that contains the archive. The full path of the directory that contains the archive. Gets the size of the archive. The size of the archive in bytes. Gets the file name of the archive. The file name of the archive, not including any path. Checks if the archive exists. True if the archive exists; else false. Gets the full path of the archive. The full path of the archive. Deletes the archive. Copies an existing archive to another location. The destination file path. Copies an existing archive to another location, optionally overwriting the destination file. The destination file path. If true, the destination file will be overwritten if it exists. Moves an existing archive to another location. The destination file path. Checks if the archive contains a valid archive header. True if the file is a valid archive; false otherwise. Gets information about the files contained in the archive. A list of objects, each containing information about a file in the archive. Gets information about the certain files contained in the archive file. The search string, such as "*.txt". A list of objects, each containing information about a file in the archive. Extracts all files from an archive to a destination directory. Directory where the files are to be extracted. Extracts all files from an archive to a destination directory, optionally extracting only newer files. Directory where the files are to be extracted. Handler for receiving progress information; this may be null if progress is not desired. Extracts a single file from the archive. The name of the file in the archive. Also includes the internal path of the file, if any. File name matching is case-insensitive. The path where the file is to be extracted on disk. If already exists, it will be overwritten. Extracts multiple files from the archive. The names of the files in the archive. Each name includes the internal path of the file, if any. File name matching is case-insensitive. This parameter may be null, but if specified it is the root directory for any relative paths in . The paths where the files are to be extracted on disk. If this parameter is null, the files will be extracted with the names from the archive. If any extracted files already exist on disk, they will be overwritten.

The and parameters cannot both be null.

Extracts multiple files from the archive, optionally extracting only newer files. The names of the files in the archive. Each name includes the internal path of the file, if any. File name matching is case-insensitive. This parameter may be null, but if specified it is the root directory for any relative paths in . The paths where the files are to be extracted on disk. If this parameter is null, the files will be extracted with the names from the archive. Handler for receiving progress information; this may be null if progress is not desired. If any extracted files already exist on disk, they will be overwritten.

The and parameters cannot both be null.

Extracts multiple files from the archive. A mapping from internal file paths to external file paths. Case-senstivity when matching internal paths depends on the IDictionary implementation. This parameter may be null, but if specified it is the root directory for any relative external paths in . If any extracted files already exist on disk, they will be overwritten. Extracts multiple files from the archive. A mapping from internal file paths to external file paths. Case-senstivity when matching internal paths depends on the IDictionary implementation. This parameter may be null, but if specified it is the root directory for any relative external paths in . Handler for receiving progress information; this may be null if progress is not desired. If any extracted files already exist on disk, they will be overwritten. Opens a file inside the archive for reading without actually extracting the file to disk. The name of the file in the archive. Also includes the internal path of the file, if any. File name matching is case-insensitive. A stream for reading directly from the packed file. Like any stream this should be closed/disposed as soon as it is no longer needed. Opens a file inside the archive for reading text with UTF-8 encoding without actually extracting the file to disk. The name of the file in the archive. Also includes the internal path of the file, if any. File name matching is case-insensitive. A reader for reading text directly from the packed file. Like any reader this should be closed/disposed as soon as it is no longer needed. To open an archived text file with different encoding, use the method and pass the returned stream to one of the constructor overloads. Compresses all files in a directory into the archive. Does not include subdirectories. The directory containing the files to be included. Uses maximum compression level. Compresses all files in a directory into the archive, optionally including subdirectories. This is the root directory for to pack all files. If true, recursively include files in subdirectories. The compression level used when creating the archive. Handler for receiving progress information; this may be null if progress is not desired. The files are stored in the archive using their relative file paths in the directory tree, if supported by the archive file format. Compresses files into the archive, specifying the names used to store the files in the archive. This parameter may be null, but if specified it is the root directory for any relative paths in . The list of files to be included in the archive. The names of the files as they are stored in the archive. Each name includes the internal path of the file, if any. This parameter may be null, in which case the files are stored in the archive with their source file names and no path information. Uses maximum compression level.

Duplicate items in the array will cause an .

Compresses files into the archive, specifying the names used to store the files in the archive. This parameter may be null, but if specified it is the root directory for any relative paths in . The list of files to be included in the archive. The names of the files as they are stored in the archive. Each name includes the internal path of the file, if any. This parameter may be null, in which case the files are stored in the archive with their source file names and no path information. The compression level used when creating the archive. Handler for receiving progress information; this may be null if progress is not desired. Duplicate items in the array will cause an . Compresses files into the archive, specifying the names used to store the files in the archive. This parameter may be null, but if specified it is the root directory for any relative paths in . A mapping from internal file paths to external file paths. Uses maximum compression level. Compresses files into the archive, specifying the names used to store the files in the archive. This parameter may be null, but if specified it is the root directory for any relative paths in . A mapping from internal file paths to external file paths. The compression level used when creating the archive. Handler for receiving progress information; this may be null if progress is not desired. Given a directory, gets the relative paths of all files in the directory, optionally including all subdirectories. The directory to search. True to include subdirectories in the search. A list of file paths relative to the directory. Retrieves information about one file from this archive. Path of the file in the archive. File information, or null if the file was not found in the archive. Creates a compression engine that does the low-level work for this object. A new compression engine instance that matches the specific subclass of archive. Each instance will be d immediately after use. Creates a case-insensitive dictionary mapping from one list of strings to the other. List of keys. List of values that are mapped 1-to-1 to the keys. A filled dictionary of the strings. Recursive-descent helper function for GetRelativeFilePathsInDirectoryTree. The root directory of the search. The relative directory to be processed now. True to descend into subdirectories. List of files found so far. Uses a CompressionEngine to get ArchiveFileInfo objects from this archive, and then associates them with this ArchiveInfo instance. Optional predicate that can determine which files to process. A list of objects, each containing information about a file in the archive. Contains the data reported in an archive progress event. Creates a new ArchiveProgressEventArgs object from specified event parameters. type of status message name of the file being processed number of the current file being processed total number of files to be processed number of bytes processed so far when compressing or extracting a file total number of bytes in the current file name of the current Archive current Archive number, when processing a chained set of Archives total number of Archives in a chained set number of compressed bytes processed so far during an extraction total number of compressed bytes to be processed during an extraction number of uncompressed file bytes processed so far total number of uncompressed file bytes to be processed Gets the type of status message. A value indicating what type of progress event occurred. The handler may choose to ignore some types of progress events. For example, if the handler will only list each file as it is compressed/extracted, it can ignore events that are not of type . Gets the name of the file being processed. (The name of the file within the Archive; not the external file path.) Also includes the internal path of the file, if any. Valid for , , and messages. The name of the file currently being processed, or null if processing is currently at the stream or archive level. Gets the number of the current file being processed. The first file is number 0, and the last file is -1. Valid for , , and messages. The number of the file currently being processed, or the most recent file processed if processing is currently at the stream or archive level. Gets the total number of files to be processed. Valid for all message types. The total number of files to be processed that are known so far. Gets the number of bytes processed so far when compressing or extracting a file. Valid for , , and messages. The number of uncompressed bytes processed so far for the current file, or 0 if processing is currently at the stream or archive level. Gets the total number of bytes in the current file. Valid for , , and messages. The uncompressed size of the current file being processed, or 0 if processing is currently at the stream or archive level. Gets the name of the current archive. Not necessarily the name of the archive on disk. Valid for all message types. The name of the current archive, or an empty string if no name was specified. Gets the current archive number, when processing a chained set of archives. Valid for all message types. The number of the current archive. The first archive is number 0, and the last archive is -1. Gets the total number of known archives in a chained set. Valid for all message types. The total number of known archives in a chained set. When using the compression option to auto-split into multiple archives based on data size, this value will not be accurate until the end. Gets the number of compressed bytes processed so far during extraction of the current archive. Valid for all extraction messages. The number of compressed bytes processed so far during extraction of the current archive. Gets the total number of compressed bytes to be processed during extraction of the current archive. Valid for all extraction messages. The total number of compressed bytes to be processed during extraction of the current archive. Gets the number of uncompressed bytes processed so far among all files. Valid for all message types. The number of uncompressed file bytes processed so far among all files. When compared to , this can be used as a measure of overall progress. Gets the total number of uncompressed file bytes to be processed. Valid for all message types. The total number of uncompressed bytes to be processed among all files. The type of progress event.

PACKING EXAMPLE: The following sequence of events might be received when extracting a simple archive file with 2 files.

Message TypeDescription StartArchive Begin extracting archive StartFile Begin extracting first file PartialFile Extracting first file PartialFile Extracting first file FinishFile Finished extracting first file StartFile Begin extracting second file PartialFile Extracting second file FinishFile Finished extracting second file FinishArchiveFinished extracting archive

UNPACKING EXAMPLE: Packing 3 files into 2 archive chunks, where the second file is continued to the second archive chunk.

Message TypeDescription StartFile Begin compressing first file FinishFile Finished compressing first file StartFile Begin compressing second file PartialFile Compressing second file PartialFile Compressing second file FinishFile Finished compressing second file StartArchive Begin writing first archive PartialArchiveWriting first archive FinishArchive Finished writing first archive StartFile Begin compressing third file PartialFile Compressing third file FinishFile Finished compressing third file StartArchive Begin writing second archive PartialArchiveWriting second archive FinishArchive Finished writing second archive
Status message before beginning the packing or unpacking an individual file. Status message (possibly reported multiple times) during the process of packing or unpacking a file. Status message after completion of the packing or unpacking an individual file. Status message before beginning the packing or unpacking an archive. Status message (possibly reported multiple times) during the process of packing or unpacking an archiv. Status message after completion of the packing or unpacking of an archive. Provides a basic implementation of the archive pack and unpack stream context interfaces, based on a list of archive files, a default directory, and an optional mapping from internal to external file paths. This class can also handle creating or extracting chained archive packages. Creates a new ArchiveFileStreamContext with a archive file and no default directory or file mapping. The path to a archive file that will be created or extracted. Creates a new ArchiveFileStreamContext with a archive file, default directory and mapping from internal to external file paths. The path to a archive file that will be created or extracted. The default root directory where files will be located, optional. A mapping from internal file paths to external file paths, optional. If the mapping is not null and a file is not included in the mapping, the file will be skipped. If the external path in the mapping is a simple file name or relative file path, it will be concatenated onto the default directory, if one was specified. For more about how the default directory and files mapping are used, see and . Creates a new ArchiveFileStreamContext with a list of archive files, a default directory and a mapping from internal to external file paths. A list of paths to archive files that will be created or extracted. The default root directory where files will be located, optional. A mapping from internal file paths to external file paths, optional. When creating chained archives, the list should include at least enough archives to handle the entire set of input files, based on the maximum archive size that is passed to the .. If the mapping is not null and a file is not included in the mapping, the file will be skipped. If the external path in the mapping is a simple file name or relative file path, it will be concatenated onto the default directory, if one was specified. For more about how the default directory and files mapping are used, see and . Gets or sets the list of archive files that are created or extracted. The list of archive files that are created or extracted. Gets or sets the default root directory where files are located. The default root directory where files are located. For details about how the default directory is used, see and . Gets or sets the mapping from internal file paths to external file paths. A mapping from internal file paths to external file paths. For details about how the files mapping is used, see and . Gets or sets a flag that can prevent extracted files from overwriting newer files that already exist. True to prevent overwriting newer files that already exist during extraction; false to always extract from the archive regardless of existing files. Gets or sets a flag that enables creating or extracting an archive at an offset within an existing file. (This is typically used to open archive-based self-extracting packages.) True to search an existing package file for an archive offset or the end of the file;/ false to always create or open a plain archive file. Gets the name of the archive with a specified number. The 0-based index of the archive within the chain. The name of the requested archive. May be an empty string for non-chained archives, but may never be null. This method returns the file name of the archive from the list with the specified index, or an empty string if the archive number is outside the bounds of the list. The file name should not include any directory path. Opens a stream for writing an archive. The 0-based index of the archive within the chain. The name of the archive that was returned by . True if the stream should be truncated when opened (if it already exists); false if an existing stream is being re-opened for writing additional data. Instance of the compression engine doing the operations. A writable Stream where the compressed archive bytes will be written, or null to cancel the archive creation. This method opens the file from the list with the specified index. If the archive number is outside the bounds of the list, this method returns null. If the flag is set, this method will seek to the start of any existing archive in the file, or to the end of the file if the existing file is not an archive. Closes a stream where an archive package was written. The 0-based index of the archive within the chain. The name of the archive that was previously returned by . A stream that was previously returned by and is now ready to be closed. Opens a stream to read a file that is to be included in an archive. The path of the file within the archive. The returned attributes of the opened file, to be stored in the archive. The returned last-modified time of the opened file, to be stored in the archive. A readable Stream where the file bytes will be read from before they are compressed, or null to skip inclusion of the file and continue to the next file. This method opens a file using the following logic: If the and the mapping are both null, the path is treated as relative to the current directory, and that file is opened. If the is not null but the mapping is null, the path is treated as relative to that directory, and that file is opened. If the is null but the mapping is not null, the path parameter is used as a key into the mapping, and the resulting value is the file path that is opened, relative to the current directory (or it may be an absolute path). If no mapping exists, the file is skipped. If both the and the mapping are specified, the path parameter is used as a key into the mapping, and the resulting value is the file path that is opened, relative to the specified directory (or it may be an absolute path). If no mapping exists, the file is skipped. Closes a stream that has been used to read a file. The path of the file within the archive; the same as the path provided when the stream was opened. A stream that was previously returned by and is now ready to be closed. Gets extended parameter information specific to the compression format being used. Name of the option being requested. Parameters for the option; for per-file options, the first parameter is typically the internal file path. Option value, or null to use the default behavior. This implementation does not handle any options. Subclasses may override this method to allow for non-default behavior. Opens the archive stream for reading. The zero-based index of the archive to open. The name of the archive being opened. Instance of the compression engine doing the operations. A stream from which archive bytes are read, or null to cancel extraction of the archive. This method opens the file from the list with the specified index. If the archive number is outside the bounds of the list, this method returns null. If the flag is set, this method will seek to the start of any existing archive in the file, or to the end of the file if the existing file is not an archive. Closes a stream where an archive was read. The archive number of the stream to close. The name of the archive being closed. The stream that was previously returned by and is now ready to be closed. Opens a stream for writing extracted file bytes. The path of the file within the archive. The uncompressed size of the file to be extracted. The last write time of the file to be extracted. A stream where extracted file bytes are to be written, or null to skip extraction of the file and continue to the next file. This method opens a file using the following logic: If the and the mapping are both null, the path is treated as relative to the current directory, and that file is opened. If the is not null but the mapping is null, the path is treated as relative to that directory, and that file is opened. If the is null but the mapping is not null, the path parameter is used as a key into the mapping, and the resulting value is the file path that is opened, relative to the current directory (or it may be an absolute path). If no mapping exists, the file is skipped. If both the and the mapping are specified, the path parameter is used as a key into the mapping, and the resulting value is the file path that is opened, relative to the specified directory (or it may be an absolute path). If no mapping exists, the file is skipped. If the flag is set, the file is skipped if a file currently exists in the same path with an equal or newer write time. Closes a stream where an extracted file was written. The path of the file within the archive. The stream that was previously returned by and is now ready to be closed. The attributes of the extracted file. The last write time of the file. After closing the extracted file stream, this method applies the date and attributes to that file. Translates an internal file path to an external file path using the and the mapping, according to rules documented in and . The path of the file with the archive. The external path of the file, or null if there is no valid translation. Stream context used to extract a single file from an archive into a memory stream. Creates a new BasicExtractStreamContext that reads from the specified archive stream. Archive stream to read from. Gets the stream for the extracted file, or null if no file was extracted. Opens the archive stream for reading. Returns a DuplicateStream instance, so the stream may be virtually opened multiple times. The archive number to open (ignored; 0 is assumed). The name of the archive being opened. Instance of the compression engine doing the operations. A stream from which archive bytes are read. Does *not* close the stream. The archive stream should be managed by the code that invokes the archive extraction. The archive number of the stream to close. The name of the archive being closed. The stream being closed. Opens a stream for writing extracted file bytes. The returned stream is a MemoryStream instance, so the file is extracted straight into memory. Path of the file within the archive. The uncompressed size of the file to be extracted. The last write time of the file. A stream where extracted file bytes are to be written. Does *not* close the file stream. The file stream is saved in memory so it can be read later. Path of the file within the archive. The file stream to be closed. The attributes of the extracted file. The last write time of the file. Base class for an engine capable of packing and unpacking a particular compressed file format. Creates a new instance of the compression engine base class. Disposes the compression engine. Occurs when the compression engine reports progress in packing or unpacking an archive. Gets or sets a flag indicating whether temporary files are created and used during compression. True if temporary files are used; false if compression is done entirely in-memory. The value of this property is true by default. Using temporary files can greatly reduce the memory requirement of compression, especially when compressing large archives. However, setting this property to false may yield slightly better performance when creating small archives. Or it may be necessary if the process does not have sufficient privileges to create temporary files. Compression level to use when compressing files. A compression level ranging from minimum to maximum compression, or no compression. Disposes of resources allocated by the compression engine. Creates an archive. A context interface to handle opening and closing of archive and file streams. The paths of the files in the archive (not external file paths). The archive could not be created. The stream context implementation may provide a mapping from the file paths within the archive to the external file paths. Creates an archive or chain of archives. A context interface to handle opening and closing of archive and file streams. The paths of the files in the archive (not external file paths). The maximum number of bytes for one archive before the contents are chained to the next archive, or zero for unlimited archive size. The archive could not be created. The stream context implementation may provide a mapping from the file paths within the archive to the external file paths. Checks whether a Stream begins with a header that indicates it is a valid archive. Stream for reading the archive file. True if the stream is a valid archive (with no offset); false otherwise. Gets the offset of an archive that is positioned 0 or more bytes from the start of the Stream. A stream for reading the archive. The offset in bytes of the archive, or -1 if no archive is found in the Stream. The archive must begin on a 4-byte boundary. Gets information about all files in an archive stream. A stream for reading the archive. Information about all files in the archive stream. The stream is not a valid archive. Gets information about files in an archive or archive chain. A context interface to handle opening and closing of archive and file streams. A predicate that can determine which files to process, optional. Information about files in the archive stream. The archive provided by the stream context is not valid. The predicate takes an internal file path and returns true to include the file or false to exclude it. Gets the list of files in an archive Stream. A stream for reading the archive. A list of the paths of all files contained in the archive. The stream is not a valid archive. Gets the list of files in an archive or archive chain. A context interface to handle opening and closing of archive and file streams. A predicate that can determine which files to process, optional. An array containing the names of all files contained in the archive or archive chain. The archive provided by the stream context is not valid. The predicate takes an internal file path and returns true to include the file or false to exclude it. Reads a single file from an archive stream. A stream for reading the archive. The path of the file within the archive (not the external file path). A stream for reading the extracted file, or null if the file does not exist in the archive. The stream is not a valid archive. The entire extracted file is cached in memory, so this method requires enough free memory to hold the file. Extracts files from an archive or archive chain. A context interface to handle opening and closing of archive and file streams. An optional predicate that can determine which files to process. The archive provided by the stream context is not valid. The predicate takes an internal file path and returns true to include the file or false to exclude it. Called by sublcasses to distribute a packing or unpacking progress event to listeners. Event details. Disposes of resources allocated by the compression engine. If true, the method has been called directly or indirectly by a user's code, so managed and unmanaged resources will be disposed. If false, the method has been called by the runtime from inside the finalizer, and only unmanaged resources will be disposed. Compresion utility function for converting old-style date and time values to a DateTime structure. Compresion utility function for converting a DateTime structure to old-style date and time values. Specifies the compression level ranging from minimum compresion to maximum compression, or no compression at all. Although only four values are enumerated, any integral value between and can also be used. Do not compress files, only store. Minimum compression; fastest. A compromize between speed and compression efficiency. Maximum compression; slowest. Wraps a source stream and carries additional items that are disposed when the stream is closed. Creates a new a cargo stream. source of the stream List of additional items that are disposed when the stream is closed. The order of the list is the order in which the items are disposed. Gets the source stream of the cargo stream. Gets the list of additional items that are disposed when the stream is closed. The order of the list is the order in which the items are disposed. The contents can be modified any time. Gets a value indicating whether the source stream supports reading. true if the stream supports reading; otherwise, false. Gets a value indicating whether the source stream supports writing. true if the stream supports writing; otherwise, false. Gets a value indicating whether the source stream supports seeking. true if the stream supports seeking; otherwise, false. Gets the length of the source stream. Gets or sets the position of the source stream. Flushes the source stream. Sets the length of the source stream. The desired length of the stream in bytes. Closes the source stream and also closes the additional objects that are carried. Reads from the source stream. An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the source. The zero-based byte offset in buffer at which to begin storing the data read from the stream. The maximum number of bytes to be read from the stream. The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. Writes to the source stream. An array of bytes. This method copies count bytes from buffer to the stream. The zero-based byte offset in buffer at which to begin copying bytes to the stream. The number of bytes to be written to the stream. Changes the position of the source stream. A byte offset relative to the origin parameter. A value of type SeekOrigin indicating the reference point used to obtain the new position. The new position within the stream. Duplicates a source stream by maintaining a separate position. WARNING: duplicate streams are not thread-safe with respect to each other or the original stream. If multiple threads use duplicate copies of the same stream, they must synchronize for any operations. Creates a new duplicate of a stream. source of the duplicate Gets the original stream that was used to create the duplicate. Gets a value indicating whether the source stream supports reading. true if the stream supports reading; otherwise, false. Gets a value indicating whether the source stream supports writing. true if the stream supports writing; otherwise, false. Gets a value indicating whether the source stream supports seeking. true if the stream supports seeking; otherwise, false. Gets the length of the source stream. Gets or sets the position of the current stream, ignoring the position of the source stream. Retrieves the original stream from a possible duplicate stream. Possible duplicate stream. If the stream is a DuplicateStream, returns the duplicate's source; otherwise returns the same stream. Flushes the source stream. Sets the length of the source stream. The desired length of the stream in bytes. Closes the underlying stream, effectively closing ALL duplicates. Reads from the source stream while maintaining a separate position and not impacting the source stream's position. An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source. The zero-based byte offset in buffer at which to begin storing the data read from the current stream. The maximum number of bytes to be read from the current stream. The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. Writes to the source stream while maintaining a separate position and not impacting the source stream's position. An array of bytes. This method copies count bytes from buffer to the current stream. The zero-based byte offset in buffer at which to begin copying bytes to the current stream. The number of bytes to be written to the current stream. Changes the position of this stream without impacting the source stream's position. A byte offset relative to the origin parameter. A value of type SeekOrigin indicating the reference point used to obtain the new position. The new position within the current stream. This interface provides the methods necessary for the 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. Gets the name of the archive with a specified number. The 0-based index of the archive within the chain. The name of the requested archive. May be an empty string for non-chained archives, but may never be null. The archive name is the name stored within the archive, used for identification of the archive especially among archive chains. That name is often, but not necessarily the same as the filename of the archive package. Opens a stream for writing an archive package. The 0-based index of the archive within the chain. The name of the archive that was returned by . True if the stream should be truncated when opened (if it already exists); false if an existing stream is being re-opened for writing additional data. Instance of the compression engine doing the operations. A writable Stream where the compressed archive bytes will be written, or null to cancel the archive creation. If this method returns null, the archive engine will throw a FileNotFoundException. Closes a stream where an archive package was written. The 0-based index of the archive within the chain. The name of the archive that was previously returned by . A stream that was previously returned by and is now ready to be closed. If there is another archive package in the chain, then after this stream is closed a new stream will be opened. Opens a stream to read a file that is to be included in an archive. The 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. Returned attributes of the opened file, to be stored in the archive. Returned last-modified time of the opened file, to be stored in the archive. A readable Stream where the file bytes will be read from before they are compressed, or null to skip inclusion of the file and continue to the next file. Closes a stream that has been used to read a file. The path of the file within the archive; the same as the path provided when the stream was opened. A stream that was previously returned by and is now ready to be closed. Gets extended parameter information specific to the compression format being used. Name of the option being requested. Parameters for the option; for per-file options, the first parameter is typically the internal file path. Option value, or null to use the default behavior. This method provides a way to set uncommon options during packaging, or a way to handle aspects of compression formats not supported by the base library. For example, this may be used by the zip compression library to specify different compression methods/levels on a per-file basis. The available option names, parameters, and expected return values should be documented by each compression library. This interface provides the methods necessary for the 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 Opens the archive stream for reading. The zero-based index of the archive to open. The name of the archive being opened. Instance of the compression engine doing the operations. A stream from which archive bytes are read, or null to cancel extraction of the archive. 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. Closes a stream where an archive package was read. The archive number of the stream to close. The name of the archive being closed. The stream that was previously returned by and is now ready to be closed. Opens a stream for writing extracted file bytes. The 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. The uncompressed size of the file to be extracted. The last write time of the file to be extracted. A stream where extracted file bytes are to be written, or null to skip extraction of the file and continue to the next file. The implementor may use the path, size and date information to dynamically decide whether or not the file should be extracted. Closes a stream where an extracted file was written. The path of the file within the archive. The stream that was previously returned by and is now ready to be closed. The attributes of the extracted file. The last write time of the file. The implementor may wish to apply the attributes and date to the newly-extracted file. Wraps a source stream and offsets all read/write/seek calls by a given value. This class is used to trick archive an packing or unpacking process into reading or writing at an offset into a file, primarily for self-extracting packages. Creates a new OffsetStream instance from a source stream and using a specified offset. Underlying stream for which all calls will be offset. Positive or negative number of bytes to offset. Gets the underlying stream that this OffsetStream calls into. Gets the number of bytes to offset all calls before redirecting to the underlying stream. Gets a value indicating whether the source stream supports reading. true if the stream supports reading; otherwise, false. Gets a value indicating whether the source stream supports writing. true if the stream supports writing; otherwise, false. Gets a value indicating whether the source stream supports seeking. true if the stream supports seeking; otherwise, false. Gets the effective length of the stream, which is equal to the length of the source stream minus the offset. Gets or sets the effective position of the stream, which is equal to the position of the source stream minus the offset. Reads a sequence of bytes from the source stream and advances the position within the stream by the number of bytes read. An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source. The zero-based byte offset in buffer at which to begin storing the data read from the current stream. The maximum number of bytes to be read from the current stream. The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. Writes a sequence of bytes to the source stream and advances the current position within this stream by the number of bytes written. An array of bytes. This method copies count bytes from buffer to the current stream. The zero-based byte offset in buffer at which to begin copying bytes to the current stream. The number of bytes to be written to the current stream. Reads a byte from the stream and advances the position within the source stream by one byte, or returns -1 if at the end of the stream. The unsigned byte cast to an Int32, or -1 if at the end of the stream. Writes a byte to the current position in the source stream and advances the position within the stream by one byte. The byte to write to the stream. Flushes the source stream. Sets the position within the current stream, which is equal to the position within the source stream minus the offset. A byte offset relative to the origin parameter. A value of type SeekOrigin indicating the reference point used to obtain the new position. The new position within the current stream. Sets the effective length of the stream, which is equal to the length of the source stream minus the offset. The desired length of the current stream in bytes. Closes the underlying stream. Distribution specific strings. News URL for the distribution. Short product name for the distribution. Support URL for the distribution. Telemetry URL format for the distribution. VS Extensions Landing page Url for the distribution.