/**
 * Creates a piped output stream connected to the specified piped
 * input stream. Data bytes written to this stream will then be
 * available as input from <code>snk</code>.
 *
 * @param      snk   The piped input stream to connect to.
 * @exception  IOException  if an I/O error occurs.
 */
 public PipedOutputStream(PipedInputStream snk)
 {
     connect(snk);
 }
 internal PassiveOutputStream(PipedInputStream In)
     : base(In)
 {
 }
 public virtual void connect(PipedInputStream snk)
 {
     if (snk == null)
     {
         throw new NullReferenceException();
     }
     else if (sink != null || snk.connected)
     {
         throw new IOException("Already connected");
     }
     sink = snk;
     snk.m_in = -1;
     snk.m_out = 0;
     snk.connected = true;
     int t=0;
 }