title: Convert IP between IPv4 and numerical format in java
body: <p>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.)</p>
  
  <p><strong>Is there any built in support in Java (8), simple and easy to use, without network access, to convert between these formats?</strong></p>
  
  <p>I need something like this:</p>
  
  <pre><code>long ip = toNumerical("1.2.3.4"); // returns 0x0000000001020304L
  String ipv4 = toIPv4(0x0000000001020304L); // returns "1.2.3.4"
  </code></pre>
  
  <p>If there is no built in such functions in Java, feel free to suggest other solutions.</p>
  
  <p>Thank you</p>