Java Integer to IP Address intToIpAddr(int ip)

Here you can find the source of intToIpAddr(int ip)

Description

int To Ip Addr

License

Open Source License

Parameter

Parameter Description
ip A quad-dotted notation string, e.g. "192.168.5.25"

Return

String

Declaration

public static String intToIpAddr(int ip) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**// w w  w .  j  a v a 2  s.c o m
     * @param ip A quad-dotted notation string, e.g. "192.168.5.25"
     * @return String
     */
    public static String intToIpAddr(int ip) {

        return "" + String.valueOf((ip) >>> 24) + "." + String.valueOf((ip & 0x00FFFFFF) >>> 16) + "."
                + String.valueOf((ip & 0x0000FFFF) >>> 8) + "." + String.valueOf(ip & 0x000000FF);
    }
}

Related

  1. intToIp(int i)
  2. intToIP(int intIP)
  3. intToIp(int ip)
  4. intToIP(int ipAddr)
  5. intToIp(int ipInt)
  6. intToIpAddress(int i)
  7. intToIpString(int ip)
  8. intToIpV4(int i)
  9. intToIpV4String(int intIp)