public static String toHexFromInt(final int value, boolean trim) {
        final StringBuffer rc = new StringBuffer(INT_OFFSETS.length * 2);
        for (int i = 0; i < INT_OFFSETS.length; i++) {
            final int b = 0xFF & value >> INT_OFFSETS[i];
            if (!(trim && b == 0)) {
                rc.append(HEX_TABLE[b]);
                trim = false;
            }
        }
        return rc.toString();
    }
@param value
@param trim
           if the leading 0's should be trimmed off.
@return
metamorphosis-commons/src/main/java/com/taobao/metamorphosis/utils/HexSupport.java