public void close() throws IOException {
   if (closed) {
     return;
   }
   closed = true;
   flush();
   LeftOverInputStream is = t.getOriginalInputStream();
   if (!is.isClosed()) {
     try {
       is.close();
     } catch (IOException e) {
     }
   }
   WriteFinishedEvent e = new WriteFinishedEvent(t);
   t.getHttpContext().getServerImpl().addEvent(e);
 }