Java tutorial
//package com.java2s; public class Main { public static int ip2int(String ip) { String[] items = ip.split("\\."); Integer intIP = Integer.valueOf(items[3]) << 24 | Integer.valueOf(items[2]) << 16 | Integer.valueOf(items[1]) << 8 | Integer.valueOf(items[0]); return intIP; } }