StringBuffer buf = new StringBuffer(20 * list.size()); buf.append(((InternetHeader) list.get(0)).getValue()); for (int i = 1; i < list.size(); i++) { buf.append(delimiter); buf.append(((InternetHeader) list.get(i)).getValue());
String[] result = new String[headers.size()]; for (int i = 0; i < headers.size(); i++) { InternetHeader header = (InternetHeader) headers.get(i); result[i] = header.getValue();
    public String getHeader(String name, String delimiter) {        List list = getHeaderList(name);        if (list == null) {            return null;        } else if (list.isEmpty()) {            return "";        } else if (list.size() == 1) {            return ((InternetHeader) list.get(0)).getValue();        } else {            StringBuffer buf = new StringBuffer(20 * list.size());            buf.append(((InternetHeader) list.get(0)).getValue());            for (int i = 1; i < list.size(); i++) {                buf.append(delimiter);                buf.append(((InternetHeader) list.get(i)).getValue());            }            return buf.toString();        }    }