List of utility methods to do Byte Array to IP Address
String | byteToIp(byte[] ip) byte To Ip String ips = ""; for (byte i : ip) { int i2 = i & 0xFF; ips += i2 + "."; if (ips.length() > 0) { ips = ips.substring(0, ips.length() - 1); return ips; |
String | byteToIp(byte[] value) byte To Ip 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(); |
String | ByteToIp(int[] ips) Byte To Ip StringBuilder sb = new StringBuilder(); sb.append(ips[0]); sb.append("."); sb.append(ips[1]); sb.append("."); sb.append(ips[2]); sb.append("."); sb.append(ips[3]); ... |