UnpackValue Method
UnpackValue(int, ReadOnlySpan<byte>)
Decode a single TLV encoded object, returning only the value.
C#
public static Memory<byte> UnpackValue(int expectedTag, ReadOnlySpan<byte> tlvData)
Parameters
Type | Name | Description |
---|---|---|
int | expectedTag | The expected tag value of the given TLV data |
ReadOnlySpan<byte> | tlvData | The TLV data |
Returns
Memory<byte>
The value of the TLV
Exceptions
Type | Condition |
---|---|
InvalidOperationException | If the TLV tag differs from expectedTag |