Here you can find the source of parseSocketAddress(String address)
public static Map.Entry<String, Integer> parseSocketAddress(String address)
//package com.java2s; //License from project: Open Source License import java.util.AbstractMap; import java.util.Map; public class Main { public static Map.Entry<String, Integer> parseSocketAddress(String address) { String hostName = null;//w w w . j av a 2 s . c o m Integer port = null; if (null != address) { if (-1 != address.indexOf(':')) { String[] split = address.split(":"); hostName = split[0]; port = Integer.valueOf(split[1]); } else { hostName = address; } } return new AbstractMap.SimpleEntry<String, Integer>(hostName, port); } }