Table of Contents

Class LibraryReservedMessagePackExtensionTypeCode

Namespace
Nerdbank.MessagePack
Assembly
Nerdbank.MessagePack.dll

Documents the library-reserved extension type codes and allows changing them to avoid conflicting with those defined by the application or another library.

public record LibraryReservedMessagePackExtensionTypeCode : IEquatable<LibraryReservedMessagePackExtensionTypeCode>
Inheritance
LibraryReservedMessagePackExtensionTypeCode
Implements
Inherited Members

Remarks

All values must be non-negative to avoid conflicting with the official extension type codes as described in ReservedMessagePackExtensionTypeCode.

A null value will disable the use of that extension type code, leading the library to either prefer a msgpack standardized encoding for the data type or fail when that data type is used.

Fields

Default

The default extension type code mapping.

public static readonly LibraryReservedMessagePackExtensionTypeCode Default

Field Value

LibraryReservedMessagePackExtensionTypeCode

Properties

BigInteger

Gets the extension type code for a BigInteger value.

public sbyte? BigInteger { get; init; }

Property Value

sbyte?

The default value is 3.

Remarks

The value is encoded as big-endian twos-complement bytes, using the fewest number of bytes possible. If the value is zero, outputs one byte whose element is 0x00.

Decimal

Gets the extension type code for a decimal value.

public sbyte? Decimal { get; init; }

Property Value

sbyte?

The default value is 4.

Remarks

The encoding matches the MS-OAUT 2.2.26 DECIMAL specification, constrained to always use little-endian byte order.

Guid

Gets the extension type code for a Guid value.

public sbyte? Guid { get; init; }

Property Value

sbyte?

The default value is 2.

Remarks

Encoded in a big endian binary format.

Int128

Gets the extension type code for a Int128 value.

public sbyte? Int128 { get; init; }

Property Value

sbyte?

Remarks

The encoding is a big endian 128-bit signed integer.

ObjectReference

Gets the extension type code for a reference to an object that has already been serialized in the same stream.

public sbyte? ObjectReference { get; init; }

Property Value

sbyte?

The default value is 1.

UInt128

Gets the extension type code for a UInt128 value.

public sbyte? UInt128 { get; init; }

Property Value

sbyte?

Remarks

The encoding is a big endian 128-bit unsigned integer.