public static Long IpConvertToInt(String ip){
String ipStr[] = ip.split("\\.");
Long result = 0L;int j;int i;
for( i = ipStr.length-1, j = 0; i >= 0; i--, j++){
Long temp = Long.parseLong(ipStr[i]);
temp = temp << (8*j);
result = result | temp;
}
System.out.println(result);
return result;
}
二:Long变成ip
public static String IntConvertToIp(Long ip){
String[] str = new String[4];
List result = new ArrayList();
for(int i = 0; i<4 ;i++){
Long temp = ip & 255;
ip = ip>>8;
str[i]=String.valu