readVarInt method
Reads a variable-length signed integer. Compatible with Protocol Buffers encoding.
Implementation
int readVarInt() {
final value = readVarUint();
if (value % 2 == 0) {
return value ~/ 2;
}
return (value ~/ -2) - 1;
}
Reads a variable-length signed integer. Compatible with Protocol Buffers encoding.
int readVarInt() {
final value = readVarUint();
if (value % 2 == 0) {
return value ~/ 2;
}
return (value ~/ -2) - 1;
}