/** * Convert the byte array representation of an IP address into a string. Supports IPv4 and IPv6 addresses. * Supports optional subnet mask stored within the same byte array. If the latter is present, * output will be: "ipAddr/mask". * * @param address IP address in byte array form (in network byte order) * @return IP address as a string, or null if can not be processed */ public static String addressToString(byte[] address) { Logger log = getLogger(); if (isIPv4(address)) { return ipv4ToString(address); } else if (isIPv6(address)) { return ipv6ToString(address); } else { log.error("IP address byte array was an invalid length: {}", address.length); return null; } }
return IPAddressHelper.addressToString((byte[]) nameValue);
return IPAddressHelper.addressToString((byte[]) nameValue);
/** * Convert the byte array representation of an IP address into a string. Supports IPv4 and IPv6 addresses. * Supports optional subnet mask stored within the same byte array. If the latter is present, * output will be: "ipAddr/mask". * * @param address IP address in byte array form (in network byte order) * @return IP address as a string, or null if can not be processed */ public static String addressToString(byte[] address) { Logger log = getLogger(); if (isIPv4(address)) { return ipv4ToString(address); } else if (isIPv6(address)) { return ipv6ToString(address); } else { log.error("IP address byte array was an invalid length: {}", address.length); return null; } }