addVarLong method

Message addVarLong(
  1. int value
)

Adds a positive or negative number to the message, using fewer bits for smaller values.

value : The value to add.

Returns the message that the value was added to.

The value is added in segments of 8 bits, 1 of which is used to indicate whether or not another segment follows. As a result, small values are added to the message using fewer bits, while large values will require a few more bits than they would if they were added via addByte, addUShort, addUInt, or addULong (or their signed counterparts).

Implementation

Message addVarLong(int value) =>
    addVarULong(Converter.zigZagEncodeLong(value));