TlvObject Constructor
TlvObject(Int32, ReadOnlySpan<Byte>)
Creates a new TLV (Tag-Length-Value) object with the specified tag and value.
C#
public TlvObject(int tag, ReadOnlySpan<byte> value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tag | The tag value, must be between 0x00 and 0xFFFF. |
System.ReadOnlySpan<System.Byte> | value | The value data as a read-only span of bytes. |
Exceptions
Type | Condition |
---|---|
TlvException | Thrown when the tag value is outside the supported range (0x00-0xFFFF). |
Remarks
This constructor creates a BER-TLV encoded structure where:
- The tag is encoded in the minimum number of bytes needed
- The length is encoded according to BER-TLV rules
- The value is stored as provided