Java Long to IP Address long2ip(long ip)

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

Description

int to ip string

License

Apache License

Parameter

Parameter Description
ip a parameter

Return

string

Declaration

public static String long2ip(long ip) 

Method Source Code

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

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)
  9. long2IpAdress(long src)