Java tutorial
//package com.java2s; public class Main { public static byte[] IPStringToBytes(String ipString) { String[] strs = ipString.split("[.]"); byte[] b = new byte[strs.length]; int index = 0; for (String str : strs) { b[index++] = (byte) (Integer.parseInt(str)); } return b; } }