public static int convertIp(String ip) {
        String[] arrayStrings = ip.split("\\.");
        return (Integer.parseInt(arrayStrings[0]) << 24)
                | (Integer.parseInt(arrayStrings[1]) << 16)
                | (Integer.parseInt(arrayStrings[2]) << 8)
                | (Integer.parseInt(arrayStrings[3]));
    }
Convert a string ip value to int.

@param ip The ip address.
@return A int ip value.
netbare-core/src/main/java/com/github/megatronking/netbare/NetBareUtils.java