Java Byte Array to IP Address byteToIp(byte[] value)

Here you can find the source of byteToIp(byte[] value)

Description

byte To Ip

License

Open Source License

Declaration

public static String byteToIp(byte[] value) 

Method Source Code

//package com.java2s;

public class Main {

    public static String byteToIp(byte[] value) {
        StringBuffer strb = new StringBuffer();
        strb.append(value[0] & 0xFF).append(".");
        strb.append(value[1] & 0xFF).append(".");
        strb.append(value[2] & 0xFF).append(".");
        strb.append(value[3] & 0xFF);
        return strb.toString();
    }/*from   w w  w .jav a  2s  .  c o  m*/

    public static String toString(Object o) {
        return String.valueOf(o);
    }
}

Related

  1. byteToIp(byte[] ip)
  2. ByteToIp(int[] ips)