Here you can find the source of ipToInt(String address)
public static int ipToInt(String address)
//package com.java2s; //License from project: Open Source License public class Main { public static int ipToInt(String address) { String[] nibbles = address.split("\\."); int result = Integer.parseInt(nibbles[0]) << 24; result |= Integer.parseInt(nibbles[1]) << 16; result |= Integer.parseInt(nibbles[2]) << 8; result |= Integer.parseInt(nibbles[3]); return result; }/*from ww w.ja v a 2 s . c o m*/ }