Class ZeroesSegment
- Namespace
- AsmResolver
- Assembly
- AsmResolver.dll
Represents a segment containing zero bytes.
public class ZeroesSegment : SegmentBase, IReadableSegment, ISegment, IOffsetProvider, IWritable
- Inheritance
-
ZeroesSegment
- Implements
- Inherited Members
- Extension Methods
Constructors
ZeroesSegment(uint)
Creates a new zeroes-filled segment.
public ZeroesSegment(uint size)
Parameters
size
uintThe number of zero bytes.
Properties
Size
Gets the number of zero bytes that are stored in this segment.
public uint Size { get; }
Property Value
Methods
CreateReader(ulong, uint)
Creates a new binary reader that reads the raw contents of the segment.
public BinaryStreamReader CreateReader(ulong fileOffset, uint size)
Parameters
Returns
- BinaryStreamReader
The created binary reader.
Exceptions
- ArgumentOutOfRangeException
Occurs when
fileOffset
is not within the range of the segment.- EndOfStreamException
Occurs when
size
indicates a too large length.
GetPhysicalSize()
Computes the number of bytes that the structure contains.
public override uint GetPhysicalSize()
Returns
- uint
The number of bytes.
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.