Class MsfFile
- Namespace
- AsmResolver.Symbols.Pdb.Msf
- Assembly
- AsmResolver.Symbols.Pdb.dll
Models a file that is in the Microsoft Multi-Stream Format (MSF).
public class MsfFile
- Inheritance
-
MsfFile
- Derived
- Inherited Members
Constructors
MsfFile()
Creates a new empty MSF file with a default block size of 4096.
public MsfFile()
MsfFile(uint)
Creates a new empty MSF file with the provided block size.
public MsfFile(uint blockSize)
Parameters
blockSize
uintThe block size to use. This must be a value of 512, 1024, 2048 or 4096.
Exceptions
- ArgumentOutOfRangeException
Occurs when an invalid block size was provided.
Properties
BlockSize
Gets or sets the size of each block in the MSF file.
public uint BlockSize { get; set; }
Property Value
Exceptions
- ArgumentOutOfRangeException
Occurs when the provided value is neither 512, 1024, 2048 or 4096.
Streams
Gets a collection of streams that are present in the MSF file.
public IList<MsfStream> Streams { get; }
Property Value
Methods
FromBytes(byte[])
Interprets a byte array as an MSF file.
public static MsfFile FromBytes(byte[] data)
Parameters
data
byte[]The data to interpret.
Returns
- MsfFile
The read MSF file.
FromFile(IInputFile)
Reads an MSF file from an input file.
public static MsfFile FromFile(IInputFile file)
Parameters
file
IInputFileThe file to read.
Returns
- MsfFile
The read MSF file.
FromFile(string)
Reads an MSF file from a file on the disk.
public static MsfFile FromFile(string path)
Parameters
path
stringThe path to the file to read.
Returns
- MsfFile
The read MSF file.
FromReader(BinaryStreamReader)
Reads an MSF file from the provided input stream reader.
public static MsfFile FromReader(BinaryStreamReader reader)
Parameters
reader
BinaryStreamReaderThe reader.
Returns
- MsfFile
The read MSF file.
GetStreams()
Obtains the list of streams stored in the MSF file.
protected virtual IList<MsfStream> GetStreams()
Returns
Remarks
This method is called upon initialization of the Streams property.
Write(BinaryStreamWriter)
Reconstructs and writes the MSF file to an output stream.
public void Write(BinaryStreamWriter writer)
Parameters
writer
BinaryStreamWriterThe output stream.
Write(BinaryStreamWriter, IMsfFileBuilder)
Reconstructs and writes the MSF file to an output stream.
public void Write(BinaryStreamWriter writer, IMsfFileBuilder builder)
Parameters
writer
BinaryStreamWriterThe output stream.
builder
IMsfFileBuilderThe builder to use for reconstructing the MSF file.
Write(Stream)
Reconstructs and writes the MSF file to an output stream.
public void Write(Stream stream)
Parameters
stream
StreamThe output stream.
Write(string)
Reconstructs and writes the MSF file to the disk.
public void Write(string path)
Parameters
path
stringThe path of the file to write to.