public static int sizeOfVarlong(long value) {
        return sizeOfUnsignedVarlong((value << 1) ^ (value >> 63));
    }
Number of bytes needed to encode a long in variable-length format.

@param value The signed value
@see #sizeOfUnsignedVarint(int)
clients/src/main/java/org/apache/kafka/common/utils/ByteUtils.java