Table of Contents

Class BlobStreamBuffer

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

Provides a mutable buffer for building up a blob stream in a .NET portable executable.

public class BlobStreamBuffer : IMetadataStreamBuffer
Inheritance
BlobStreamBuffer
Implements
Inherited Members

Constructors

BlobStreamBuffer()

Creates a new blob stream buffer with the default blob stream name.

public BlobStreamBuffer()

BlobStreamBuffer(string)

Creates a new blob stream buffer.

public BlobStreamBuffer(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 blob data. Calling AppendRawData(byte[]) or GetBlobIndex(byte[]?) on the same data will append the data a second time.

CreateStream()

Serialises the blob stream buffer to a metadata stream.

public BlobStream CreateStream()

Returns

BlobStream

The metadata stream.

GetBlobIndex(ITypeCodedIndexProvider, BlobSignature?, IErrorListener)

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

public uint GetBlobIndex(ITypeCodedIndexProvider provider, BlobSignature? signature, IErrorListener errorListener)

Parameters

provider ITypeCodedIndexProvider

The object to use for obtaining metadata tokens for members in the tables stream.

signature BlobSignature

The signature to lookup or add.

errorListener IErrorListener

The object responsible for collecting diagnostic information.

Returns

uint

The index of the signature.

GetBlobIndex(byte[]?)

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

public uint GetBlobIndex(byte[]? blob)

Parameters

blob byte[]

The blob to lookup or add.

Returns

uint

The index of the blob.

ImportStream(BlobStream)

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

public void ImportStream(BlobStream stream)

Parameters

stream BlobStream

The stream to import.