Java Long to IP Address long2ip(long ip)

Here you can find the source of long2ip(long ip)

Description

longip

License

Open Source License

Declaration

public static String long2ip(long ip) 

Method Source Code

//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;
    }
}

Related

  1. long2Ip(final long ip)
  2. long2ip(long address)
  3. long2ip(long ip)
  4. long2ip(long ip)
  5. long2ip(long ip)
  6. long2ip(long ipLong)
  7. long2IP(long ipLong)
  8. long2IP(long proper_address)