# ArchiveCorruptionException

Malformed archive or compressed data. Names the format, the byte offset in the input where the problem was found and the structure that was expected there.

Class 

`OfficeIMO.Archives`

**Namespace**

`OfficeIMO.Archives`

**Assembly**

`OfficeIMO.Archives`

**Source revision**

`273d35d5ba8a` with working tree changes

**Source**

[ArchiveCorruptionException.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/ArchiveCorruptionException.cs#L13)

**Base**

`IOException`

**Implements**

`ISerializable`

**Modifiers**

sealed

Malformed archive or compressed data. Names the format, the byte offset in the input where the problem was found and the structure that was expected there.

## Inheritance

- IOException
- ArchiveCorruptionException

## Remarks

Derives from IOException, like OfficeInspectionResourceLimitException. Readers that predate it still report corruption as InvalidDataException.

Filter members 

Show inherited

## Constructors

ArchiveCorruptionException 2 overloads

`public ArchiveCorruptionException(string format, long offset, string expected)` [#](#constructor-ctor-string-int64-string)

[ArchiveCorruptionException.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/ArchiveCorruptionException.cs#L13)

Creates the exception for format data that is invalid at offset.

Parameters

**format string required**

The format being decoded, for example Zstandard.

**offset long required**

Zero-based byte offset in the input, counted from where decoding started.

**expected string required**

What the decoder expected at that offset.

`public ArchiveCorruptionException(string format, long offset, string expected, Exception? innerException)` [#](#constructor-ctor-string-int64-string-exception)

[ArchiveCorruptionException.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/ArchiveCorruptionException.cs#L22)

Creates the exception with the error that caused it.

Parameters

**format string required**

The format being decoded, for example Zstandard.

**offset long required**

Zero-based byte offset in the input, counted from where decoding started.

**expected string required**

What the decoder expected at that offset.

**innerException System.Exception? required**

The error that caused this one, or null.

## Inherited Methods

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

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual Exception GetBaseException()` [#](#method-getbaseexception)

Inherited from Exception

Returns

`Exception`

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

Inherited from object

Returns

`int`

`public virtual void GetObjectData(SerializationInfo info, StreamingContext context)` [#](#method-getobjectdata-serializationinfo-streamingcontext)

Inherited from Exception

`Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId = "SYSLIB0051", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")` `EditorBrowsable(1)`

Parameters

**info SerializationInfo required**

**context StreamingContext required**

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

Inherited from Exception

Returns

`Type`

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

Inherited from Exception

Returns

`string`

## Properties

`public string Format { get; }` [#](#property-format)

[ArchiveCorruptionException.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/ArchiveCorruptionException.cs#L29)

The format being decoded.

`public long Offset { get; }` [#](#property-offset)

[ArchiveCorruptionException.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/ArchiveCorruptionException.cs#L32)

Zero-based byte offset in the input where the problem was found.

`public string Expected { get; }` [#](#property-expected)

[ArchiveCorruptionException.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Archives/ArchiveCorruptionException.cs#L35)

What the decoder expected at [ArchiveCorruptionException.Offset](/api/archives/officeimo-archives-archivecorruptionexception/).

## Inherited Properties

`public MethodBase? TargetSite { get; }` [#](#property-targetsite)

Inherited from Exception

`public virtual string Message { get; }` [#](#property-message)

Inherited from Exception

`public virtual IDictionary Data { get; }` [#](#property-data)

Inherited from Exception

`public Exception? InnerException { get; }` [#](#property-innerexception)

Inherited from Exception

`public virtual string? HelpLink { get; set; }` [#](#property-helplink)

Inherited from Exception

`public virtual string? Source { get; set; }` [#](#property-source)

Inherited from Exception

`public int HResult { get; set; }` [#](#property-hresult)

Inherited from Exception

`public virtual string? StackTrace { get; }` [#](#property-stacktrace)

Inherited from Exception

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