docs: public static int getVarInt(InputStream inputStream) throws IOException {
      int result = 0;
      int shift = 0;
      int b;
      do {
        if (shift >= 32) {
          // Out of range
          throw new IndexOutOfBoundsException("varint too long");
        }
        // Get 7 bits from next byte
        b = inputStream.read();
        result |= (b & 0x7F) << shift;
        shift += 7;
      } while ((b & 0x80) != 0);
      return result;
    }