An IPv4 can have more representations: as string (a.b.c.d) or numerical (as an unsigned int of 32 bits). (Maybe other, but I will ignore them.)
Is there any built in support in Java (8), simple and easy to use, without network access, to convert between these formats?
I need something like this:
long ip = toNumerical("1.2.3.4"); // returns 0x0000000001020304L
String ipv4 = toIPv4(0x0000000001020304L); // returns "1.2.3.4"
If there is no built in such functions in Java, feel free to suggest other solutions.
Thank you