Table of Contents

Class MsfFileBuffer

Namespace
AsmResolver.Symbols.Pdb.Msf.Builder
Assembly
AsmResolver.Symbols.Pdb.dll

Represents a mutable buffer for building up a new MSF file.

public class MsfFileBuffer : SegmentBase, ISegment, IOffsetProvider, IWritable
Inheritance
MsfFileBuffer
Implements
Inherited Members

Constructors

MsfFileBuffer(uint)

Creates a new empty MSF file buffer.

public MsfFileBuffer(uint blockSize)

Parameters

blockSize uint

The block size to use.

Properties

SuperBlock

Gets the super block of the MSF file that is being constructed.

public MsfSuperBlock SuperBlock { get; }

Property Value

MsfSuperBlock

Methods

BlockIsAvailable(int)

Determines whether a block in the MSF file buffer is available or not.

public bool BlockIsAvailable(int blockIndex)

Parameters

blockIndex int

The index of the block.

Returns

bool

true if the block is available, false otherwise.

CreateStreamDirectory(IList<MsfStream>)

Constructs a new MSF stream containing the stream directory.

public MsfStream CreateStreamDirectory(IList<MsfStream> streams)

Parameters

streams IList<MsfStream>

The files that the directory should list.

Returns

MsfStream

The constructed stream.

Remarks

This method does not add the stream to the buffer, nor does it update the super block.

CreateStreamDirectoryMap(MsfStream)

Creates a new MSF stream containing the block indices of the stream directory.

public MsfStream CreateStreamDirectoryMap(MsfStream streamDirectory)

Parameters

streamDirectory MsfStream

The stream directory to store the indices for.

Returns

MsfStream

The constructed stream.

Remarks

This method does not add the stream to the buffer, nor does it update the super block.

GetBlockIndicesForStream(MsfStream)

Gets the allocated indices for the provided MSF stream.

public int[] GetBlockIndicesForStream(MsfStream stream)

Parameters

stream MsfStream

The stream.

Returns

int[]

The block indices.

GetPhysicalSize()

Computes the number of bytes that the structure contains.

public override uint GetPhysicalSize()

Returns

uint

The number of bytes.

InsertBlock(int, MsfStream, int)

Inserts a block of the provided MSF stream into the buffer.

public void InsertBlock(int blockIndex, MsfStream stream, int chunkIndex)

Parameters

blockIndex int

The MSF file index to insert the block into.

stream MsfStream

The stream to pull a chunk from.

chunkIndex int

The index of the chunk to store at the provided block index.

Exceptions

ArgumentException

Occurs when the index provided by blockIndex is already in use.

Write(BinaryStreamWriter)

Serializes the structure to an output stream.

public override void Write(BinaryStreamWriter writer)

Parameters

writer BinaryStreamWriter

The output stream to write the data to.