代碼如下:
/** * 整型解析為IP地址 * @param num * @return */ public static String int2iP(Long num) { String str = null; Long[] tt = new Long[4]; tt[0] = (num >>> 24) >>> 0; tt[1] = ((num << 8) >>> 24) >>> 0; tt[2] = (num << 16) >>> 24; tt[3] = (num << 24) >>> 24; str = (tt[0]) + "." + (tt[1]) + "." + (tt[2]) + "." + (tt[3]); return str; }
作者:csdn博客 微wx笑