2196550012_10 = 82ECB17C_16
82_16 = 130
EC_16 = 236
B1_16 = 177
7C_16 = 124
Seems you have to use masks if you need to split an integer to four octets.
a.b.c.d
And yes some IP-s will be stored as negative integers.Code:a = (ip >> 24) & 0xFF; b = (ip >> 16) & 0xFF; c = (ip >> 8) & 0xFF; d = (ip ) & 0xFF;
Tip: read as long, then convert to int:
Gives the result: -2098417284_10 = 82ECB17C_16.Code:long a = 2196550012L; System.out.println( (int)a );




Reply With Quote