# SevenZipArchiveWriter

Creates single-volume 7z archives with independent or solid Copy and LZMA2 streams.

Class 

`OfficeIMO.Archives`

**Namespace**

`OfficeIMO.Archives`

**Assembly**

`OfficeIMO.Archives`

**Source revision**

`12511d2fa560` with working tree changes

**Source**

[SevenZipArchiveWriter.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/12511d2fa560784a40564a2dc62102d2005ed547/OfficeIMO.Archives/SevenZipArchiveWriter.cs#L41)

**Modifiers**

static

Creates single-volume 7z archives with independent or solid Copy and LZMA2 streams.

## Inheritance

- object
- SevenZipArchiveWriter

## Remarks

Members retain their input order. Names use inline UTF-16, modification times use UTC FILETIME, and each nonempty member has a CRC-32. Independent streams are limited to 448 MiB of decoded data and 448 MiB of packed data in total, with a 256 MiB limit per member. Solid mode limits the decoded folder to 256 MiB. The writer supports up to 200,000 entries and 32 MiB of encoded names.

Filter members 

Show inherited

## Methods

Create 2 overloads

`public static void Create(Stream destination, IEnumerable<ArchiveWriteEntry> entries, SevenZipArchiveWriterOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-create-io-stream-collections-generic-ienumerable-officeimo-archives-archivewriteentry-officeimo-archives-sevenziparchivewriteroptions-threading-cancellationtoken)

[SevenZipArchiveWriter.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/12511d2fa560784a40564a2dc62102d2005ed547/OfficeIMO.Archives/SevenZipArchiveWriter.cs#L41)

Writes to the current position of a writable stream and leaves it open. The stream need not seek. All entry sources are staged before publication. Cancellation or I/O failure during publication can leave a prefix.

Parameters

**destination System.IO.Stream required**

**entries System.Collections.Generic.IEnumerable<OfficeIMO.Archives.ArchiveWriteEntry> required**

**options OfficeIMO.Archives.SevenZipArchiveWriterOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

`public static void Create(string destinationPath, IEnumerable<ArchiveWriteEntry> entries, SevenZipArchiveWriterOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-create-string-collections-generic-ienumerable-officeimo-archives-archivewriteentry-officeimo-archives-sevenziparchivewriteroptions-threading-cancellationtoken)

[SevenZipArchiveWriter.cs:64](https://github.com/EvotecIT/OfficeIMO/blob/12511d2fa560784a40564a2dc62102d2005ed547/OfficeIMO.Archives/SevenZipArchiveWriter.cs#L64)

Atomically writes the supplied entry sequence to a new 7z path. An existing destination causes an I/O error.

Parameters

**destinationPath string required**

**entries System.Collections.Generic.IEnumerable<OfficeIMO.Archives.ArchiveWriteEntry> required**

**options OfficeIMO.Archives.SevenZipArchiveWriterOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:D6BEDDDE22A6FC7C1B3DFF73020D0127FDDC3144A8BBC6A098A6A78AD7A1D878 -->
