@Test public void testNormalConnect() { try { out.connect(in); } catch (IOException e) { fail("The pipe is already connected"); } catch(NullPointerException e) { fail("The source being connected to is null"); } }
public synchronized void connect(NoClosePipedInputStream snk) throws IOException { if (snk == null) { throw new NullPointerException(); } else if (sink != null) { throw new IOException("Already connected"); } sink = snk; snk.in = -1; snk.out = 0; snk.connected = true; }
NoClosePipedOutputStream extends OutputStream { public synchronized void connect(NoClosePipedInputStream snk) throws IOException { if (snk == null) { throw new NullPointerException(); } else if (sink != null) { throw new IOException("Already connected"); } sink = snk; snk.in = -1; snk.out = 0; snk.connected = true; } }
NoClosePipedOutputStream extends OutputStream { public synchronized void connect(NoClosePipedInputStream snk) throws IOException { if (snk == null) { throw new NullPointerException(); } else if (sink != null) { throw new IOException("Already connected"); } sink = snk; snk.in = -1; snk.out = 0; snk.connected = true; } NoClosePipedOutputStream(NoClosePipedInputStream snk);  NoClosePipedOutputStream(); }
NoClosePipedOutputStream extends OutputStream { public synchronized void connect(NoClosePipedInputStream snk) throws IOException { if (snk == null) { throw new NullPointerException(); } else if (sink != null) { throw new IOException("Already connected"); } sink = snk; snk.in = -1; snk.out = 0; snk.connected = true; } NoClosePipedOutputStream(NoClosePipedInputStream snk);  NoClosePipedOutputStream(); synchronized void connect(NoClosePipedInputStream snk); void write(int b); void write(byte b[], int off, int len); }
NoClosePipedOutputStream extends OutputStream { public synchronized void connect(NoClosePipedInputStream snk) throws IOException { if (snk == null) { throw new NullPointerException(); } else if (sink != null) { throw new IOException("Already connected"); } sink = snk; snk.in = -1; snk.out = 0; snk.connected = true; } NoClosePipedOutputStream(NoClosePipedInputStream snk);  NoClosePipedOutputStream(); synchronized void connect(NoClosePipedInputStream snk); void write(int b); void write(byte b[], int off, int len);  }