Class MsfStream
- Namespace
- AsmResolver.Symbols.Pdb.Msf
- Assembly
- AsmResolver.Symbols.Pdb.dll
Represents a single stream in an Multi-Stream Format (MSF) file.
public class MsfStream : IOwnedCollectionElement<MsfFile>
- Inheritance
-
MsfStream
- Implements
- Inherited Members
Constructors
MsfStream(IDataSource)
Creates a new MSF stream with the provided data source as contents.
public MsfStream(IDataSource contents)
Parameters
contents
IDataSourceThe data source containing the raw data of the stream.
MsfStream(IDataSource, IEnumerable<int>)
Initializes an MSF stream with a data source and a list of original block indices that the stream was based on.
public MsfStream(IDataSource contents, IEnumerable<int> originalBlockIndices)
Parameters
contents
IDataSourceThe data source containing the raw data of the stream.
originalBlockIndices
IEnumerable<int>The original block indices that this MSF stream was based on.
MsfStream(byte[])
Creates a new MSF stream with the provided contents.
public MsfStream(byte[] data)
Parameters
data
byte[]The raw data of the stream.
Properties
Contents
Gets or sets the contents of the stream.
public IDataSource Contents { get; set; }
Property Value
OriginalBlockIndices
Gets a collection of block indices that this stream was based of (if available).
public IList<int> OriginalBlockIndices { get; }
Property Value
Parent
Gets the parent MSF file that this stream is embedded in.
public MsfFile? Parent { get; }
Property Value
Methods
CreateReader()
Creates a new binary reader that reads the raw contents of the stream.
public BinaryStreamReader CreateReader()
Returns
- BinaryStreamReader
The constructed binary reader.
GetRequiredBlockCount()
Gets the amount of blocks that is required to store this MSF stream.
public int GetRequiredBlockCount()
Returns
- int
The number of blocks.
Exceptions
- InvalidOperationException
Occurs when the stream is not added to a file.
GetRequiredBlockCount(uint)
Gets the amount of blocks that is required to store this MSF stream, given the provided block size.
public int GetRequiredBlockCount(uint blockSize)
Parameters
blockSize
uintThe block size.
Returns
- int
The number of blocks.