Here you can find the source of longToIp(long ip)
protected static String longToIp(long ip)
//package com.java2s; //License from project: Apache License public class Main { protected static String longToIp(long ip) { StringBuilder sb = new StringBuilder(15); for (int i = 0; i < 4; i++) { sb.insert(0, Long.toString(ip & 0xff)); if (i < 3) { sb.insert(0, '.'); }/* w w w .j a va 2s . c om*/ ip >>= 8; } return sb.toString(); } }