Java Long to IP Address LongToIp(long longIp)

Here you can find the source of LongToIp(long longIp)

Description

Long To Ip

License

Apache License

Declaration

public static String LongToIp(long longIp) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String LongToIp(long longIp) {
        StringBuffer sb = new StringBuffer("");

        sb.append(String.valueOf((longIp >>> 24)));
        sb.append(".");

        sb.append(String.valueOf((longIp & 0x00FFFFFF) >>> 16));
        sb.append(".");

        sb.append(String.valueOf((longIp & 0x0000FFFF) >>> 8));
        sb.append(".");

        sb.append(String.valueOf((longIp & 0x000000FF)));
        return sb.toString();
    }/*ww w .  ja v  a 2  s . c om*/
}

Related

  1. longToIp(long address)
  2. longToIp(long i)
  3. longToIp(long i)
  4. longToIp(long ip)
  5. longToIp(long ip)
  6. longToIp(long longValue)
  7. longToIp(String ip)
  8. longToIpAddress(long ip)
  9. longToIPv4(final long ipaddress)