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
uintThe block size to use.
Properties
SuperBlock
Gets the super block of the MSF file that is being constructed.
public MsfSuperBlock SuperBlock { get; }
Property Value
Methods
BlockIsAvailable(int)
Determines whether a block in the MSF file buffer is available or not.
public bool BlockIsAvailable(int blockIndex)
Parameters
blockIndex
intThe 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
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
MsfStreamThe 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
MsfStreamThe 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
intThe MSF file index to insert the block into.
stream
MsfStreamThe stream to pull a chunk from.
chunkIndex
intThe 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
BinaryStreamWriterThe output stream to write the data to.