Here you can find the source of long2ip(long ip)
public static String long2ip(long ip)
//package com.java2s; //License from project: Open Source License public class Main { public static String long2ip(long ip) { String result = ""; while (ip > 0) { if (!"".equals(result)) { result = "." + result; }//w w w . j a v a 2 s . c o m result = ip % 256 + result; ip = (long) Math.floor(ip / 256); } return result; } }