I have an int which contains an IP address in network byte order, which I would like to convert to an InetAddress object. I see that there is an <
int
InetAddress
Tested and working:
int ip = ... ; String ipStr = String.format("%d.%d.%d.%d", (ip & 0xff), (ip >> 8 & 0xff), (ip >> 16 & 0xff), (ip >> 24 & 0xff));