Java Integer to IP Address Int2Ip(long ip)

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

Description

Int Ip

License

Apache License

Declaration

public static String Int2Ip(long ip) 

Method Source Code

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

public class Main {
    public static String Int2Ip(long ip) {
        long[] b = new long[4];
        b[0] = (long) ((ip >> 24) & 0xff);
        b[1] = (long) ((ip >> 16) & 0xff);
        b[2] = (long) ((ip >> 8) & 0xff);
        b[3] = (long) (ip & 0xff);

        return b[0] + "." + b[1] + "." + b[2] + "." + b[3];
    }//from  ww  w. j  av  a  2 s.c o m
}

Related

  1. int2ip(int ipInt)
  2. int2IP(long ip)
  3. int2IpAddressString(long i)
  4. int2ipstr(int addr)
  5. int2IpStr(long ip)
  6. intToIp(int address)