Here you can find the source of long2ip(long ip)
Parameter | Description |
---|---|
ip | a parameter |
public static String long2ip(long ip)
//package com.java2s; //License from project: Apache License public class Main { /**/* w w w.j a v a 2 s.c o m*/ * int to ip string * * @param ip * @return string */ public static String long2ip(long ip) { StringBuilder sb = new StringBuilder(); sb.append((ip >> 24) & 0xFF).append('.').append((ip >> 16) & 0xFF).append('.').append((ip >> 8) & 0xFF) .append('.').append((ip >> 0) & 0xFF); return sb.toString(); } }