Bob was asking for the string representation of an integer IP number. His 
solution is correct, straightforward and does not require the instantiation 
of three intermediate objects just for getting a simple string. Your 
one-liner however creates a BigInteger, then a byte array and finally an 
instance of InetAddress which still is not a string. It's toString method 
may or may not return the resolved host name in addition to the IP number 
string representation. That's not quite the original requirement.



On Tuesday, February 19, 2013 9:43:35 AM UTC-6, Larry Meadors wrote:
>
> On Tue, Feb 19, 2013 at 8:05 AM, bob <[email protected]<javascript:>> 
> wrote: 
> > Why do you say that? 
>
> Because it's a ridiculously obfuscated solution to a problem with a 
> simple one-line solution: 
>
> InetAddress address = 
> InetAddress.getByAddress(BigInteger.valueOf(actualIpAddressAsInt).toByteArray());
>  
>
>
> Larry 
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to