Here you can find the source of int2IP(long ip)
Parameter | Description |
---|---|
i | a parameter |
public static String int2IP(long ip)
//package com.java2s; public class Main { /**/*from ww w .j av a 2 s. c o m*/ * @param i * @return */ public static String int2IP(long ip) { StringBuffer sb = new StringBuffer(15); for (int shift = 24; shift > 0; shift -= 8) { // process 3 bytes, from high order byte down. sb.append(Long.toString((ip >>> shift) & 0xff)); sb.append('.'); } sb.append(Long.toString(ip & 0xff)); return sb.toString(); } }