BiffRecordHeader Struct
Definition
Represents the four-byte header that precedes every BIFF record: a 16-bit little-endian record identifier followed by the 16-bit little-endian length of the payload that follows.
public readonly struct BiffRecordHeader : IEquatable<BiffRecordHeader>
- Implements
- Inherited Members
- Extension Methods
Remarks
BiffReader parses a header for every record it frames and exposes the current one as Header; the type is public so a caller framing records itself - a stream scanner skipping payloads, for example - shares the same layout. Length is the declared payload length, which a conformant writer keeps within GetMaxPayloadLength(BiffVersion).
Constructors
BiffRecordHeader(ushort, ushort)
Represents the four-byte header that precedes every BIFF record: a 16-bit little-endian record identifier followed by the 16-bit little-endian length of the payload that follows.
public BiffRecordHeader(ushort Id, ushort Length)
Parameters
Remarks
BiffReader parses a header for every record it frames and exposes the current one as Header; the type is public so a caller framing records itself - a stream scanner skipping payloads, for example - shares the same layout. Length is the declared payload length, which a conformant writer keeps within GetMaxPayloadLength(BiffVersion).
- See Also
Properties
Id
The 16-bit record identifier.
public ushort Id { get; init; }
Property Value
Length
The declared payload length, in bytes.
public ushort Length { get; init; }
Property Value
Type
Gets the record identifier as a BiffRecordType.
public BiffRecordType Type { get; }
Property Value
- BiffRecordType
The typed identifier. The value may not correspond to a defined member when the record is one the codec does not name.
Methods
Deconstruct(out ushort, out ushort)
public void Deconstruct(out ushort Id, out ushort Length)
Parameters
Equals(BiffRecordHeader)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(BiffRecordHeader other)
Parameters
otherBiffRecordHeaderAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
TryParse(ReadOnlySpan<byte>, out BiffRecordHeader)
Attempts to parse a record header from the start of the supplied bytes.
public static bool TryParse(ReadOnlySpan<byte> source, out BiffRecordHeader header)
Parameters
sourceReadOnlySpan<byte>The bytes to parse.
headerBiffRecordHeaderWhen this method returns, the parsed header when one was available.
Returns
- bool
true when
sourceholds at least RecordHeaderSize bytes; otherwise false.
WriteTo(Span<byte>)
Writes the header to the start of the supplied buffer.
public void WriteTo(Span<byte> destination)
Parameters
Exceptions
- ArgumentException
Thrown when
destinationis shorter than RecordHeaderSize.
Operators
operator ==(BiffRecordHeader, BiffRecordHeader)
public static bool operator ==(BiffRecordHeader left, BiffRecordHeader right)
Parameters
leftBiffRecordHeaderrightBiffRecordHeader
Returns
operator !=(BiffRecordHeader, BiffRecordHeader)
public static bool operator !=(BiffRecordHeader left, BiffRecordHeader right)
Parameters
leftBiffRecordHeaderrightBiffRecordHeader
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |