Added ipv4ToString method

This commit is contained in:
nathan 2019-01-16 22:33:54 +01:00
parent d9e7b4b0f7
commit 4eaf81c053

View File

@ -237,6 +237,15 @@ class NetworkUtil {
return null;
}
/**
* @return the String representation of the given IPv4 address
*/
public static
String ipv4ToString(byte[] address) {
return (address[0] & 0xFF) + "." + (address[1] & 0xFF) + "." + (address[2] & 0xFF) + "." + (address[3] & 0xFF);
}
private
NetworkUtil() {
}