Table of Contents

Class UserStringsStreamBuffer

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

Provides a mutable buffer for building up a user-strings stream in a .NET portable executable.

public class UserStringsStreamBuffer : IMetadataStreamBuffer
Inheritance
UserStringsStreamBuffer
Implements
Inherited Members

Constructors

UserStringsStreamBuffer()

Creates a new user-strings stream buffer with the default user-strings stream name.

public UserStringsStreamBuffer()

UserStringsStreamBuffer(string)

Creates a new user-strings stream buffer.

public UserStringsStreamBuffer(string name)

Parameters

name string

The name of the stream.

Properties

IsEmpty

Gets a value indicating whether the metadata stream buffer does not contain any data.

public bool IsEmpty { get; }

Property Value

bool

Name

Gets the name of the stream.

public string Name { get; }

Property Value

string

Methods

AppendRawData(byte[])

Appends raw data to the stream.

public uint AppendRawData(byte[] data)

Parameters

data byte[]

The data to append.

Returns

uint

The index to the start of the data.

Remarks

This method does not index the string. Calling AppendRawData(byte[]) or GetStringIndex(string?) on the same data will append the data a second time.

CreateStream()

Serializes

public UserStringsStream CreateStream()

Returns

UserStringsStream

GetStringIndex(string?)

Gets the index to the provided user-string. If the string is not present in the buffer, it will be appended to the end of the stream.

public uint GetStringIndex(string? value)

Parameters

value string

The user-string to lookup or add.

Returns

uint

The index of the user-string.

ImportStream(UserStringsStream)

Imports the contents of a user strings stream and indexes all present strings.

public void ImportStream(UserStringsStream stream)

Parameters

stream UserStringsStream

The stream to import.