public static Frame readFrame(DataInputStream in) throws IOException {
String verb=Util.readLine(in);
if(verb == null)
throw new EOFException("reading verb");
if(verb.length() == 0)
return null;
verb=verb.trim();
Map<String,String> headers=new HashMap<String,String>();
byte[] body=null;
for(;;) {
String header=Util.readLine(in);
if(header == null)
throw new EOFException("reading header");
if(header.length() == 0)
break;
int index=header.indexOf(":");
if(index != -1)
headers.put(header.substring(0, index).trim(), header.substring(index+1).trim());