Well, take the IP format in this form:
192.168.1.1
, , , 8 .
long l = 192 | (168 << 8) | (1 << 16) | (1 << 24);
, .
:
int b1 = (int) (l & 0xff);
int b2 = (int) ((l >> 8) & 0xff);
int b3 = (int) ((l >> 16) & 0xff);
int b4 = (int) ((l >> 24) & 0xff);
-
, , " " #, , , , , , , - IP-.