MetadataReaderProvider.FromMetadataImage Method

Definition

Overloads

FromMetadataImage(ImmutableArray<Byte>)

Creates a provider over a byte array.

FromMetadataImage(Byte*, Int32)

Creates a metadata provider over an image stored in memory.

FromMetadataImage(ImmutableArray<Byte>)

Source:
MetadataReaderProvider.cs
Source:
MetadataReaderProvider.cs
Source:
MetadataReaderProvider.cs
Source:
MetadataReaderProvider.cs

Creates a provider over a byte array.

public static System.Reflection.Metadata.MetadataReaderProvider FromMetadataImage (System.Collections.Immutable.ImmutableArray<byte> image);

Parameters

image
ImmutableArray<Byte>

Metadata image.

Returns

The new provider.

Exceptions

image is null.

Remarks

The content of the image is not read during the construction of the MetadataReaderProvider.

Applies to

.NET 9 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
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

FromMetadataImage(Byte*, Int32)

Source:
MetadataReaderProvider.cs
Source:
MetadataReaderProvider.cs
Source:
MetadataReaderProvider.cs
Source:
MetadataReaderProvider.cs

Creates a metadata provider over an image stored in memory.

public static System.Reflection.Metadata.MetadataReaderProvider FromMetadataImage (byte* start, int size);

Parameters

start
Byte*

Pointer to the start of the metadata blob.

size
Int32

The size of the metadata blob.

Returns

The new metadata provider.

Exceptions

size is negative.

Remarks

The memory is owned by the caller and is not released on disposal of the MetadataReaderProvider.

The caller is responsible for keeping the memory alive and unmodified throughout the lifetime of the MetadataReaderProvider.

The content of the blob is not read during the construction of the MetadataReaderProvider.

Applies to

.NET 9 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
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)