final long readVarint64() {
    byte b; // negative number implies MSB set
    if ((b = readByte()) >= 0) {
      return b;
    }

    long result = b & 0x7f;
    for (int i = 1; b < 0 && i < 10; i++) {
      b = readByte();
      if (i == 9 && (b & 0xf0) != 0) {
        throw new IllegalArgumentException("Greater than 64-bit varint at position " + (pos() - 1));
      }
      result |= (long) (b & 0x7f) << (i * 7);
    }
    return result;
  }
@return the value read. Use {@link WriteBuffer#varintSizeInBytes(long)} to tell how many bytes.
@throws IllegalArgumentException if more than 64 bits were encoded
zipkin/src/main/java/zipkin2/internal/ReadBuffer.java