WriteInt16 Method
WriteInt16(Int32, Int16, Boolean)
Add a 16-bit integer as the value to be written out.
C#
public void WriteInt16(int tag, short value, bool bigEndian = true)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tag | The tag that will be written out when this TLV is encoded. |
System.Int16 | value | The short to be converted into a byte array. |
System.Boolean | bigEndian | If true, write out the short as big endian, with the high order byte of the value in the left most position in the byte array. If false, write out the value as little endian, with the low order byte of the value in the left most position in the byte array. The default is true, so if no argument is given, the value will be written as big endian. |
Exceptions
Type | Condition |
---|---|
TlvException | The tag is invalid. |