public static int computeRawVarint32Size(final int value)
    {
        if ((value & (0xffffffff << 7)) == 0)
            return 1;
        if ((value & (0xffffffff << 14)) == 0)
            return 2;
        if ((value & (0xffffffff << 21)) == 0)
            return 3;
        if ((value & (0xffffffff << 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.
protostuff-core/src/main/java/io/protostuff/ProtobufOutput.java