Here you can find the source of ipToByte(String ip)
private static int[] ipToByte(String ip)
//package com.java2s; //License from project: Open Source License public class Main { private static int[] ipToByte(String ip) { int[] result = new int[4]; String[] ipPart = ip.split("\\."); result[0] = Integer.parseInt(ipPart[0]); result[1] = Integer.parseInt(ipPart[1]); result[2] = Integer.parseInt(ipPart[2]); result[3] = Integer.parseInt(ipPart[3]); return result; }//w w w . java 2 s. c o m }