title: Creating InetAddress object in Java
body: <p>I am trying to convert an address specified by an IP number or a name, both in String (i.e. <code>localhost</code> or <code>127.0.0.1</code>), into an <em>InetAdress</em> object. There's no constructor but rather static methods that return an <em>InetAddress</em>. So if I get a host name it's not a problem, but what if I get the IP number? There's one method that gets <em>byte[]</em> but I'm not sure how that can help me. All other methods gets the host name.</p>
  
  <p><a href="http://download.oracle.com/javase/1.4.2/docs/api/java/net/InetAddress.html">InetAddress API documentation</a></p>