Interface ISegmentReference
- Namespace
- AsmResolver
- Assembly
- AsmResolver.dll
Represents a reference to a segment in a binary file, such as the beginning of a function or method body, or a reference to a chunk of initialization data of a field.
public interface ISegmentReference : IOffsetProvider
- Inherited Members
Properties
CanRead
Gets a value indicating whether the referenced segment can be read using a binary reader.
bool CanRead { get; }
Property Value
IsBounded
Gets a value indicating whether the referenced segment is bounded to a fixed size.
bool IsBounded { get; }
Property Value
Methods
CreateReader()
Creates a binary reader starting at the beginning of the segment.
BinaryStreamReader CreateReader()
Returns
- BinaryStreamReader
The binary reader.
Remarks
When CanRead is false
, it is not guaranteed this method will succeed.
GetSegment()
Obtains the segment referenced by this reference.
ISegment? GetSegment()
Returns
- ISegment
The segment.
Remarks
When IsBounded is false
, it is not guaranteed this method will succeed.
Exceptions
- InvalidOperationException
Occurs when the segment could not be obtained.