System.IO.Compression Specifies values that indicate whether a compression operation emphasizes speed or compression size. The compression operation should complete as quickly as possible, even if the resulting file is not optimally compressed. No compression should be performed on the file. The compression operation should be optimally compressed, even if the operation takes a longer time to complete. Specifies whether to compress or decompress the underlying stream. Compresses the underlying stream. Decompresses the underlying stream. Provides methods and properties for compressing and decompressing streams by using the Deflate algorithm. Initializes a new instance of the class by using the specified stream and compression level. The stream to compress. One of the enumeration values that indicates whether to emphasize speed or compression efficiency when compressing the stream. is null. The stream does not support write operations such as compression. (The property on the stream object is false.) Initializes a new instance of the class by using the specified stream and compression level, and optionally leaves the stream open. The stream to compress. One of the enumeration values that indicates whether to emphasize speed or compression efficiency when compressing the stream. true to leave the stream object open after disposing the object; otherwise, false. is null. The stream does not support write operations such as compression. (The property on the stream object is false.) Initializes a new instance of the class by using the specified stream and compression mode. The stream to compress or decompress. One of the enumeration values that indicates whether to compress or decompress the stream. is null. is not a valid value.-or- is and is false.-or- is and is false. Initializes a new instance of the class by using the specified stream and compression mode, and optionally leaves the stream open. The stream to compress or decompress. One of the enumeration values that indicates whether to compress or decompress the stream. true to leave the stream open after disposing the object; otherwise, false. is null. is not a valid value.-or- is and is false.-or- is and is false. Gets a reference to the underlying stream. A stream object that represents the underlying stream. The underlying stream is closed. Gets a value indicating whether the stream supports reading while decompressing a file. true if the value is Decompress, and the underlying stream is opened and supports reading; otherwise, false. Gets a value indicating whether the stream supports seeking. false in all cases. Gets a value indicating whether the stream supports writing. true if the value is Compress, and the underlying stream supports writing and is not closed; otherwise, false. Releases the unmanaged resources used by the and optionally releases the managed resources. true to release both managed and unmanaged resources; false to release only unmanaged resources. The current implementation of this method has no functionality. The stream is closed. This property is not supported and always throws a . A long value. This property is not supported on this stream. This property is not supported and always throws a . A long value. This property is not supported on this stream. Reads a number of decompressed bytes into the specified byte array. The number of bytes that were read into the byte array. The array to store decompressed bytes. The byte offset in at which the read bytes will be placed. The maximum number of decompressed bytes to read. is null. The value was Compress when the object was created.- or - The underlying stream does not support reading. or is less than zero.-or- length minus the index starting point is less than . The data is in an invalid format. The stream is closed. This operation is not supported and always throws a . A long value. The location in the stream. One of the values. This property is not supported on this stream. This operation is not supported and always throws a . The length of the stream. This property is not supported on this stream. Writes compressed bytes to the underlying stream from the specified byte array. The buffer that contains the data to compress. The byte offset in from which the bytes will be read. The maximum number of bytes to write. Provides methods and properties used to compress and decompress streams. Initializes a new instance of the class by using the specified stream and compression level. The stream to write the compressed data to. One of the enumeration values that indicates whether to emphasize speed or compression efficiency when compressing the stream. is null. The stream does not support write operations such as compression. (The property on the stream object is false.) Initializes a new instance of the class by using the specified stream and compression level, and optionally leaves the stream open. The stream to write the compressed data to. One of the enumeration values that indicates whether to emphasize speed or compression efficiency when compressing the stream. true to leave the stream object open after disposing the object; otherwise, false. is null. The stream does not support write operations such as compression. (The property on the stream object is false.) Initializes a new instance of the class by using the specified stream and compression mode. The stream the compressed or decompressed data is written to. One of the enumeration values that indicates whether to compress or decompress the stream. is null. is not a valid enumeration value.-or- is and is false.-or- is and is false. Initializes a new instance of the class by using the specified stream and compression mode, and optionally leaves the stream open. The stream the compressed or decompressed data is written to. One of the enumeration values that indicates whether to compress or decompress the stream. true to leave the stream open after disposing the object; otherwise, false. is null. is not a valid value.-or- is and is false.-or- is and is false. Gets a reference to the underlying stream. A stream object that represents the underlying stream. The underlying stream is closed. Gets a value indicating whether the stream supports reading while decompressing a file. true if the value is Decompress, and the underlying stream supports reading and is not closed; otherwise, false. Gets a value indicating whether the stream supports seeking. false in all cases. Gets a value indicating whether the stream supports writing. true if the value is Compress, and the underlying stream supports writing and is not closed; otherwise, false. Releases the unmanaged resources used by the and optionally releases the managed resources. true to release both managed and unmanaged resources; false to release only unmanaged resources. The current implementation of this method has no functionality. The stream is closed. This property is not supported and always throws a . A long value. This property is not supported on this stream. This property is not supported and always throws a . A long value. This property is not supported on this stream. Reads a number of decompressed bytes into the specified byte array. The number of bytes that were decompressed into the byte array. If the end of the stream has been reached, zero or the number of bytes read is returned. The array used to store decompressed bytes. The byte offset in at which the read bytes will be placed. The maximum number of decompressed bytes to read. is null. The value was Compress when the object was created.- or -The underlying stream does not support reading. or is less than zero.-or- length minus the index starting point is less than . The data is in an invalid format. The stream is closed. This property is not supported and always throws a . A long value. The location in the stream. One of the values. This property is not supported on this stream. This property is not supported and always throws a . The length of the stream. This property is not supported on this stream. Writes compressed bytes to the underlying stream from the specified byte array. The buffer that contains the data to compress. The byte offset in from which the bytes will be read. The maximum number of bytes to write. The write operation cannot be performed because the stream is closed. Represents a package of compressed files in the zip archive format. Initializes a new instance of the class from the specified stream. The stream that contains the archive to be read. The stream is already closed or does not support reading. is null. The contents of the stream are not in the zip archive format. Initializes a new instance of the class from the specified stream and with the specified mode. The input or output stream. One of the enumeration values that indicates whether the zip archive is used to read, create, or update entries. The stream is already closed, or the capabilities of the stream do not match the mode. is null. is an invalid value. The contents of the stream could not be interpreted as a zip archive.-or- is and an entry is missing from the archive or is corrupt and cannot be read.-or- is and an entry is too large to fit into memory. Initializes a new instance of the class on the specified stream for the specified mode, and optionally leaves the stream open. The input or output stream. One of the enumeration values that indicates whether the zip archive is used to read, create, or update entries. true to leave the stream open after the object is disposed; otherwise, false. The stream is already closed, or the capabilities of the stream do not match the mode. is null. is an invalid value. The contents of the stream could not be interpreted as a zip archive.-or- is and an entry is missing from the archive or is corrupt and cannot be read.-or- is and an entry is too large to fit into memory. Initializes a new instance of the class on the specified stream for the specified mode, uses the specified encoding for entry names, and optionally leaves the stream open. The input or output stream. One of the enumeration values that indicates whether the zip archive is used to read, create, or update entries. true to leave the stream open after the object is disposed; otherwise, false. The encoding to use when reading or writing entry names in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names. The stream is already closed, or the capabilities of the stream do not match the mode. is null. is an invalid value. The contents of the stream could not be interpreted as a zip archive.-or- is and an entry is missing from the archive or is corrupt and cannot be read.-or- is and an entry is too large to fit into memory. Creates an empty entry that has the specified path and entry name in the zip archive. An empty entry in the zip archive. A path, relative to the root of the archive, that specifies the name of the entry to be created. is . is null. The zip archive does not support writing. The zip archive has been disposed. Creates an empty entry that has the specified entry name and compression level in the zip archive. An empty entry in the zip archive. A path, relative to the root of the archive, that specifies the name of the entry to be created. One of the enumeration values that indicates whether to emphasize speed or compression effectiveness when creating the entry. is . is null. The zip archive does not support writing. The zip archive has been disposed. Releases the resources used by the current instance of the class. Called by the and methods to release the unmanaged resources used by the current instance of the class, and optionally finishes writing the archive and releases the managed resources. true to finish writing the archive and release unmanaged and managed resources; false to release only unmanaged resources. Gets the collection of entries that are currently in the zip archive. The collection of entries that are currently in the zip archive. The zip archive does not support reading. The zip archive has been disposed. The zip archive is corrupt, and its entries cannot be retrieved. Retrieves a wrapper for the specified entry in the zip archive. A wrapper for the specified entry in the archive; null if the entry does not exist in the archive. A path, relative to the root of the archive, that identifies the entry to retrieve. is . is null. The zip archive does not support reading. The zip archive has been disposed. The zip archive is corrupt, and its entries cannot be retrieved. Gets a value that describes the type of action the zip archive can perform on entries. One of the enumeration values that describes the type of action (read, create, or update) the zip archive can perform on entries. Represents a compressed file within a zip archive. Gets the zip archive that the entry belongs to. The zip archive that the entry belongs to, or null if the entry has been deleted. Gets the compressed size of the entry in the zip archive. The compressed size of the entry in the zip archive. The value of the property is not available because the entry has been modified. Deletes the entry from the zip archive. The entry is already open for reading or writing. The zip archive for this entry was opened in a mode other than . The zip archive for this entry has been disposed. Gets the relative path of the entry in the zip archive. The relative path of the entry in the zip archive. Gets or sets the last time the entry in the zip archive was changed. The last time the entry in the zip archive was changed. The attempt to set this property failed, because the zip archive for the entry is in mode. The archive mode is set to .- or -The archive mode is set to and the entry has been opened. An attempt was made to set this property to a value that is either earlier than 1980 January 1 0:00:00 (midnight) or later than 2107 December 31 23:59:58 (one second before midnight). Gets the uncompressed size of the entry in the zip archive. The uncompressed size of the entry in the zip archive. The value of the property is not available because the entry has been modified. Gets the file name of the entry in the zip archive. The file name of the entry in the zip archive. Opens the entry from the zip archive. The stream that represents the contents of the entry. The entry is already currently open for writing.-or-The entry has been deleted from the archive.-or-The archive for this entry was opened with the mode, and this entry has already been written to. The entry is either missing from the archive or is corrupt and cannot be read. -or-The entry has been compressed by using a compression method that is not supported. The zip archive for this entry has been disposed. Retrieves the relative path of the entry in the zip archive. The relative path of the entry, which is the value stored in the property. Specifies values for interacting with zip archive entries. Only creating new archive entries is permitted. Only reading archive entries is permitted. Both read and write operations are permitted for archive entries.