Here you can find the source of ipToString(final byte[] address)
Parameter | Description |
---|---|
address | the address |
public static String ipToString(final byte[] address)
//package com.java2s; public class Main { /**// www . ja va 2s.c o m * Convert specified array of bytes into an ip-string. * * @param address the address * @return the ip address */ public static String ipToString(final byte[] address) { final StringBuffer sb = new StringBuffer(address.length * 4); for (int i = 0; i < address.length; i++) { final int element = address[i] & 0xFF; if (0 != i) { sb.append('.'); } sb.append(element); } return sb.toString(); } }