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