public static final int stringPositiveSize(final long x) {
        long p = 10;
        for (int i = 1; i < 19; i++) {
            if (x < p) {
                return i;
            }
            p = 10 * p;
        }
        return 19;
    }
All possible chars for representing a number as a String
metamorphosis-commons/src/main/java/com/taobao/metamorphosis/network/ByteUtils.java