I am trying to convert strings into Inetaddress. I am not trying to resolve hostnames, the strings are ipv4 addresses, does InetAddress.getByName(String host) work? Or do I have to manually parse it?
+1
A:
Yes, that will work. The API is very clear on this ("The host name can either be a machine name, such as "java.sun.com", or a textual representation of its IP address."), and of course you could easily check yourself.
Matthew Flaschen
2010-02-22 05:45:03
Thanks, I looked up the api, and missed that line.
TiansHUo
2010-02-22 05:49:12