code: public void writeVInt(int value) {
          if(value < 0) {
              writeByte((byte)0x80);
              return;
          }
  
          if(value > 0x0FFFFFFF) writeByte((byte)(0x80 | ((value >>> 28))));
          if(value > 0x1FFFFF)   writeByte((byte)(0x80 | ((value >>> 21) & 0x7F)));
          if(value > 0x3FFF)     writeByte((byte)(0x80 | ((value >>> 14) & 0x7F)));
          if(value > 0x7F)       writeByte((byte)(0x80 | ((value >>>  7) & 0x7F)));
  
          writeByte((byte)(value & 0x7F));
      }
docs: Writes a variable-byte encoded integer to the byte array.