if (headers!=null) {
    Enumeration key = headers.keys();
    while (key.hasMoreElements()) {
String keystring=(String)key.nextElement();
writeString(keystring+":"+(String)headers.get(keystring)+crlf);
    }
}