Java IP Address to String ipToIPv4Str(byte[] ip)

Here you can find the source of ipToIPv4Str(byte[] ip)

Description

ip To I Pv Str

License

Apache License

Declaration

public static String ipToIPv4Str(byte[] ip) 

Method Source Code

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

public class Main {
    public static String ipToIPv4Str(byte[] ip) {
        if (ip.length != 4) {
            return null;
        }//from   w  w  w.  j a v a  2s. co  m
        return new StringBuilder().append(ip[0] & 0xFF).append(".").append(ip[1] & 0xFF).append(".")
                .append(ip[2] & 0xFF).append(".").append(ip[3] & 0xFF).toString();
    }
}

Related

  1. convertIpToString(byte[] ip)
  2. inputStreamContent(InputStream is)
  3. ip2string(byte[] ip)
  4. ip2string(byte[] ips)
  5. ip2String(int ip)
  6. ipToString(final byte[] address)
  7. ipToString(final byte[] bytes)
  8. IpToString(int address)
  9. IPToString(int intIP)