Here you can find the source of ip2Long(String ipAddress)
public static long ip2Long(String ipAddress)
//package com.java2s; //License from project: Apache License public class Main { public static long ip2Long(String ipAddress) { String[] ipAddressInArray = ipAddress.split("[.]"); long result = 0; for (int i = 3; i >= 0; i--) { long ip = Long.parseLong(ipAddressInArray[3 - i]); result |= ip << (i * 8); }/*from w ww . j a va2 s . c om*/ return result; } }