code: @GwtIncompatible("ObjectOutput")
    private void writeEncodedInt(ObjectOutput out, int value) throws IOException {
      while (value > 0X7f || value < 0) {
        out.writeByte(((value & 0X7f) | 0x80));
        value >>>= 7;
      }
      out.writeByte(value);
    }
docs: Encode integers using variable length encoding.
  
  Encodes an integer as a sequence of 7-bit values with a continuation bit. For example the
  number 3912 (0111 0100 1000) is encoded in two bytes as follows 0xC80E (1100 1000 0000 1110),
  i.e. first byte will be the lower 7 bits with a continuation bit set and second byte will
  consist of the upper 7 bits with the continuation bit unset.
  
  This encoding aims to reduce the serialized footprint for the most common values, reducing the
  footprint for all positive values that are smaller than 2^21 (~2000000):
  0 -       127 are encoded in one byte
  128 -     16384 are encoded in two bytes
  16385 -   2097152 are encoded in three bytes
  2097153 - 268435456 are encoded in four bytes.
  values greater than 268435456 and negative values are encoded in 5 bytes.
  
  Most values for the length field will be encoded with one byte and most values for
  sourcePosition will be encoded with 2 or 3 bytes. (Value -1, which is used to mark absence will
  use 5 bytes, and could be accommodated in the present scheme by an offset of 1 if it leads to
  size improvements).