ReadUInt2 method

Starting with the byte referred to by DataOffset, the ReadUInt2 method reads 2 bytes from the Message Data buffer and returns them as a Long (signed 4-byte) integer value.

The method fails if MQMessage.DataLength is less than 2 when it is issued.

DataOffset is incremented by 2 and DataLength is decremented by 2 if the method succeeds.

The 2 bytes of message data are assumed to be an unsigned binary integer. The encoding is specified by the MQMessage.Encoding property.

Defined in:
MQMessage class
Syntax:
bigint& = MQMessage .ReadUInt2