Change . My previous answer would be passed on 128.0.0.0to 255.255.255.255up 0.0.0.0to 127.255.255.255. Presumably you want to go from 0.0.0.0to 255.255.255.255, so I edited my solution to do this.
int i = -1;
do {
i++;
int b1 = (i >> 24) & 0xff;
int b2 = (i >> 16) & 0xff;
int b3 = (i >> 8) & 0xff;
int b4 = (i ) & 0xff;
} while(i != -1);
: , - ( , 1 1 -1 ), . , Integer.MAX_VALUE Integer.MIN_VALUE - .
. IP-, , , , :
for(long n = Integer.MIN_VALUE; n <= Integer.MAX_VALUE; n++)
{
int i = (int)n;
int b1 = (i >> 24) & 0xff;
int b2 = (i >> 16) & 0xff;
int b3 = (i >> 8) & 0xff;
int b4 = (i ) & 0xff;
}
: int long, ( int <= Integer.MAX_VALUE).