Here you can find the source of toAddressString(InetSocketAddress address)
public static String toAddressString(InetSocketAddress address)
//package com.java2s; //License from project: Apache License import java.net.*; public class Main { public static String toAddressString(InetSocketAddress address) { return address.getAddress().getHostAddress() + ":" + address.getPort(); }//from w w w . j a v a 2 s. c om }