MetadataReader Constructors

Definition

Overloads

MetadataReader(Byte*, Int32)

Initializes a new instance of the MetadataReader class from the metadata stored at the given memory location.

MetadataReader(Byte*, Int32, MetadataReaderOptions)

Initializes a new instance of the MetadataReader class from the metadata stored at the given memory location.

MetadataReader(Byte*, Int32, MetadataReaderOptions, MetadataStringDecoder)

Initializes a new instance of the MetadataReader class from the metadata stored at the given memory location.

MetadataReader(Byte*, Int32)

Source:
MetadataReader.cs
Source:
MetadataReader.cs
Source:
MetadataReader.cs
Source:
MetadataReader.cs

Initializes a new instance of the MetadataReader class from the metadata stored at the given memory location.

C#
public MetadataReader(byte* metadata, int length);

Parameters

metadata
Byte*

A pointer to the first byte in a block of metadata.

length
Int32

The number of bytes in the block.

Remarks

The memory is owned by the caller. It must be kept alive and unmodified throughout the lifetime of the MetadataReader.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0

MetadataReader(Byte*, Int32, MetadataReaderOptions)

Source:
MetadataReader.cs
Source:
MetadataReader.cs
Source:
MetadataReader.cs
Source:
MetadataReader.cs

Initializes a new instance of the MetadataReader class from the metadata stored at the given memory location.

C#
public MetadataReader(byte* metadata, int length, System.Reflection.Metadata.MetadataReaderOptions options);

Parameters

metadata
Byte*
length
Int32

Remarks

The memory is owned by the caller. It must be kept memory alive and unmodified throughout the lifetime of the MetadataReader.

Use PEReaderExtensions.GetMetadataReader(PEReader, MetadataReaderOptions) to obtain metadata from a PE image.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0

MetadataReader(Byte*, Int32, MetadataReaderOptions, MetadataStringDecoder)

Source:
MetadataReader.cs
Source:
MetadataReader.cs
Source:
MetadataReader.cs
Source:
MetadataReader.cs

Initializes a new instance of the MetadataReader class from the metadata stored at the given memory location.

C#
public MetadataReader(byte* metadata, int length, System.Reflection.Metadata.MetadataReaderOptions options, System.Reflection.Metadata.MetadataStringDecoder utf8Decoder);
C#
public MetadataReader(byte* metadata, int length, System.Reflection.Metadata.MetadataReaderOptions options, System.Reflection.Metadata.MetadataStringDecoder? utf8Decoder);

Parameters

metadata
Byte*
length
Int32
utf8Decoder
MetadataStringDecoder

Exceptions

length is not positive.

metadata is null.

The encoding of utf8Decoder is not UTF8Encoding.

The current platform is big-endian.

Bad metadata header.

Remarks

The memory is owned by the caller. It must be kept memory alive and unmodified throughout the lifetime of the MetadataReader.

Use PEReaderExtensions.GetMetadataReader(PEReader, MetadataReaderOptions, MetadataStringDecoder) to obtain metadata from a PE image.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0