static int sizeOfUnsignedVarint(int value) {
        int bytes = 1;
        while ((value & 0xffffff80) != 0L) {
            bytes += 1;
            value >>>= 7;
        }
        return bytes;
    }
Return the number of bytes needed to encode an integer in unsigned variable-length format.
generator/src/main/java/org/apache/kafka/message/MessageGenerator.java