public void run()
 {
  byte b[];
  int rb;

  b=new byte[512];

  mainloop:while(true)
  {
     try
     {
      if(Thread.interrupted()) return;
      rb=in.read(b);
      if(rb==-1) break mainloop;
      out.write(b,0,rb);
      out.flush();
     }
     catch (InterruptedIOException timeout)
     {
      notify.interrupt();
      return;
     }
     catch (IOException data_error)
     {
      notify.interrupt();
      return;
     }
 }
 notify.interrupt();
}