Here you can find the source of addr_to_sbuf(InetSocketAddress addr, StringBuffer buf)
public static void addr_to_sbuf(InetSocketAddress addr, StringBuffer buf)
//package com.java2s; /*//from w ww. jav a2 s . c om * Copyright (c) 2001-2003 Regents of the University of California. * All rights reserved. * * See the file LICENSE included in this distribution for details. */ import java.net.InetSocketAddress; public class Main { public static void addr_to_sbuf(InetSocketAddress addr, StringBuffer buf) { buf.append(addr.getAddress().getHostAddress()); buf.append(":"); buf.append(addr.getPort()); } }