Table of Contents

Class MetadataBuffer

Namespace
AsmResolver.DotNet.Builder.Metadata
Assembly
AsmResolver.DotNet.dll

Provides a default implementation for IMetadataBuffer that produces compressed metadata (#~).

public class MetadataBuffer : IMetadataBuffer
Inheritance
MetadataBuffer
Implements
Inherited Members

Constructors

MetadataBuffer()

Creates a new metadata directory buffer that targets runtime version v4.0.30319.

public MetadataBuffer()

MetadataBuffer(string)

Creates a new metadata directory buffer.

public MetadataBuffer(string versionString)

Parameters

versionString string

The runtime version string to use.

Properties

BlobStream

Gets the mutable blob stream (#Blob) buffer of this metadata directory.

public BlobStreamBuffer BlobStream { get; }

Property Value

BlobStreamBuffer

GuidStream

Gets the mutable GUID stream (#GUID) buffer of this metadata directory.

public GuidStreamBuffer GuidStream { get; }

Property Value

GuidStreamBuffer

OptimizeStringIndices

Gets or sets a value indicating whether the strings stream should be optimized for size upon constructing the metadata directory. This means that strings that are a suffix of another will not be added twice to the buffer, but rather will be referenced using an offset within the longer string. This avoids lots of duplication in the final stream.

public bool OptimizeStringIndices { get; set; }

Property Value

bool

StringsStream

Gets the mutable strings stream (#Strings) buffer of this metadata directory.

public StringsStreamBuffer StringsStream { get; }

Property Value

StringsStreamBuffer

TablesStream

Gets the mutable tables stream (#~ or #-) buffer of this metadata directory.

public TablesStreamBuffer TablesStream { get; }

Property Value

TablesStreamBuffer

UserStringsStream

Gets the mutable user-strings stream (#US) buffer of this metadata directory.

public UserStringsStreamBuffer UserStringsStream { get; }

Property Value

UserStringsStreamBuffer

Methods

CreateMetadata()

Flushes all metadata stream buffers and builds up a new metadata directory.

public MetadataDirectory CreateMetadata()

Returns

MetadataDirectory

The constructed metadata directory.