public static int computeRawVarInt32Size(final int value) {
        if ((value & (~0 << 7)) == 0) {
            return 1;
        }
        if ((value & (~0 << 14)) == 0) {
            return 2;
        }
        if ((value & (~0 << 21)) == 0) {
            return 3;
        }
        if ((value & (~0 << 28)) == 0) {
            return 4;
        }
        return 5;
    }
Compute the number of bytes that would be needed to encode a varInt.
{@code value} is treated as unsigned, so it won't be sign-extended
if negative.
jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/util/VarInts.java