Here you can find the source of ipToIPv4Str(byte[] ip)
public static String ipToIPv4Str(byte[] ip)
//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(); } }