@Override
    public void close() throws IOException {
      bout.close();
      output.close();

      Iterator<MessageHandler> it = config.getMessagerHandlers();

      while (it.hasNext()) {
        MessageHandler handler = it.next();
        handler.handleRequest(url, bout.toByteArray());
      }
    }
 @Override
 public void write(byte b[]) throws IOException {
   bout.write(b);
   output.write(b);
 }
 @Override
 public void write(byte b[], int off, int len) throws IOException {
   bout.write(b, off, len);
   output.write(b, off, len);
 }
 @Override
 public void write(int b) throws IOException {
   bout.write((char) b);
   output.write(b);
 }