# ZstandardDictionary

A Zstandard dictionary for frames compressed against shared content (RFC 8878, section 5).

Class 

`OfficeIMO.Archives`

**Namespace**

`OfficeIMO.Archives`

**Assembly**

`OfficeIMO.Archives`

**Source revision**

`273d35d5ba8a` with working tree changes

**Source**

[ZstandardArchive.cs:44](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/ZstandardArchive.cs#L44)

**Modifiers**

sealed

A Zstandard dictionary for frames compressed against shared content (RFC 8878, section 5).

## Inheritance

- object
- ZstandardDictionary

## Usage

Explore 3 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 2

- Method [ZstandardDictionary.Load](/api/archives/officeimo-archives-zstandarddictionary/#method-load-byte-officeimo-archives-archivereadoptions)
- Method [ZstandardDictionary.LoadRaw](/api/archives/officeimo-archives-zstandarddictionary/#method-loadraw-byte-officeimo-archives-archivereadoptions)

### Accepted by parameters 1

- Method [ZstandardArchive.DecompressWithDictionary](/api/archives/officeimo-archives-zstandardarchive/#method-decompresswithdictionary-io-stream-io-stream-officeimo-archives-zstandarddictionary-officeimo-archives-archivereadoptions-threading-cancellationtoken) parameter `dictionary`

Filter members 

Show inherited

## Methods

`public static ZstandardDictionary Load(byte[] dictionary, ArchiveReadOptions? options = null)` [#](#method-load-byte-officeimo-archives-archivereadoptions)

[ZstandardArchive.cs:44](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/ZstandardArchive.cs#L44)

Parses a dictionary, such as one written by zstd --train. Bytes without the dictionary magic number are used as raw content, which must be at least 8 bytes. The content is held to [ArchiveReadOptions.MaxWindowBytes](/api/archives/officeimo-archives-archivereadoptions/) of options before it is copied.

Parameters

**dictionary byte[] required**

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

Returns

`ZstandardDictionary`

Exceptions

- `ArchiveCorruptionException` – The dictionary header or tables are malformed.
- `OfficeInspectionResourceLimitException` – The content is larger than the window limit.

`public static ZstandardDictionary LoadRaw(byte[] content, ArchiveReadOptions? options = null)` [#](#method-loadraw-byte-officeimo-archives-archivereadoptions)

[ZstandardArchive.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/ZstandardArchive.cs#L54)

Uses content as a raw-content dictionary, even when it starts with the dictionary magic number, as zstd's raw dictionary mode does. Raw content must be at least 8 bytes and has dictionary ID zero. It is held to [ArchiveReadOptions.MaxWindowBytes](/api/archives/officeimo-archives-archivereadoptions/) of options before it is copied.

Parameters

**content byte[] required**

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

Returns

`ZstandardDictionary`

Exceptions

- `ArchiveCorruptionException` – content is shorter than 8 bytes.
- `OfficeInspectionResourceLimitException` – The content is larger than the window limit.

## 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?`

## Properties

`public uint Id { get; }` [#](#property-id)

[ZstandardArchive.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/ZstandardArchive.cs#L30)

Dictionary ID from the dictionary header, or zero for a raw-content dictionary.

`public bool HasEntropyTables { get; }` [#](#property-hasentropytables)

[ZstandardArchive.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/ZstandardArchive.cs#L33)

True when the dictionary carries its own entropy tables and repeat offsets.

`public int ContentLength { get; }` [#](#property-contentlength)

[ZstandardArchive.cs:36](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/ZstandardArchive.cs#L36)

Length of the dictionary content that frames may reference.

<!-- PowerForge markdown artifact sha256:680E7DFABE14845257A445C43E381EFDDF4396ECCEBC0BB21D8D9B164748D57E -->
