public void connect (PipedWriter src) throws IOException { if (closed) throw new IOException ("already closed"); if (writer != null) { if (writer == src) return; throw new IOException ("already connected"); } try { writer = src; writer.connect(this); } catch (IOException e) { writer = null; throw e; } }
connect(PipedWriter src) throws IOException { if (src == this.src) return;  if (ever_connected) throw new IOException("Already connected");  if (closed) throw new IOException("Stream is closed and cannot be reopened");  synchronized (lock) {  src.connect(this);  ever_connected = true;  } }
  public void connect (PipedWriter src) throws IOException  {    if (closed)      throw new IOException ("already closed");    if (writer != null)      {	if (writer == src)	  return;	throw new IOException ("already connected");      }    try      {	writer = src;	writer.connect(this);      }    catch (IOException e)      {	writer = null;	throw e;      }  }