writeVarInt method

void writeVarInt(
  1. int value
)

Writes variable-length signed integer.

Implementation

void writeVarInt(int value) {
  if (value < 0) {
    writeVarUint(-2 * value - 1);
  } else {
    writeVarUint(2 * value);
  }
}