WriteValue Method
WriteValue(Int32, ReadOnlySpan<Byte>)
Add a byte array as a value to be written out.
C#
public void WriteValue(int tag, ReadOnlySpan<byte> value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tag | The tag that will be written out when this TLV is encoded. |
System.ReadOnlySpan<System.Byte> | value | The byte array that is the value. |
Exceptions
Type | Condition |
---|---|
TlvException | The tag is invalid, or the length is unsupported. |
Remarks
When an Encode method is called, the tag and value given will be written out as the T and V of the TLV.
If there is no data, pass an empty Span
:
ReadOnlySpan<byte>.Empty
. In that case, what is written
out is simply tag 00.