Here you can find the source of ipv4ToInt(String address)
public static int ipv4ToInt(String address)
//package com.java2s; //License from project: Open Source License public class Main { public static int ipv4ToInt(String address) { String[] p = address.split("[.]"); return (Integer.parseInt(p[0]) << 24) | (Integer.parseInt(p[1]) << 16) | (Integer.parseInt(p[2]) << 8) | (Integer.parseInt(p[3])); }// w ww .j a v a2s . c om }