Possible duplicate:
Is there an easy way to convert String to Inetaddress in Java?
I am trying to convert a string (representing an IP address, e.g. 10.0.2.50 ) to an InetAddress obj object.
According to the API, you can create an object that provides a string that represents the host name (for example, www.google.ch ). This is not an option for me, since I do not have a host name for each InetAddress object that I want to create (except that it takes too much time).
Is it possible to convert a String (e.g. 10.0.2.50 ) into an InetAddress obj. Object? (according to the api, this can be done if you have an IP like byte[] , but how do I convert a String containing an IP address to byte[] ?)
java ip
rob Apr 6 '11 at 19:15 2011-04-06 19:15
source share