@Test public void testNotConnectedIntRead() { try{ in.read(); fail("This test should have already thrown an IOException"); } catch (IOException e) { assertEquals("Pipe not connected", e.getMessage()); return; } fail("This test should have thrown an IOException"); }
public synchronized int read() throws IOException { if (!connected) { throw new IOException("Pipe not connected"); } while (in < 0) { notifyAll(); try { wait(1000); } catch (InterruptedException ex) { throw new java.io.InterruptedIOException(); } } int ret = buffer[out++] & 0xFF; if (out >= buffer.length) { out = 0; } if (in == out) { in = -1; } return ret; }
NoClosePipedInputStream extends InputStream { public synchronized int read() throws IOException { if (!connected) { throw new IOException("Pipe not connected"); } while (in < 0) { notifyAll(); try { wait(1000); } catch (InterruptedException ex) { throw new java.io.InterruptedIOException(); } } int ret = buffer[out++] & 0xFF; if (out >= buffer.length) { out = 0; } if (in == out) { in = -1; } return ret; } }
NoClosePipedInputStream extends InputStream { public synchronized int read() throws IOException { if (!connected) { throw new IOException("Pipe not connected"); } while (in < 0) { notifyAll(); try { wait(1000); } catch (InterruptedException ex) { throw new java.io.InterruptedIOException(); } } int ret = buffer[out++] & 0xFF; if (out >= buffer.length) { out = 0; } if (in == out) { in = -1; } return ret; } NoClosePipedInputStream(NoClosePipedOutputStream src);  NoClosePipedInputStream(NoClosePipedOutputStream src, int pipeSize);  NoClosePipedInputStream();  NoClosePipedInputStream(int pipeSize); }
NoClosePipedInputStream extends InputStream { public synchronized int read() throws IOException { if (!connected) { throw new IOException("Pipe not connected"); } while (in < 0) { notifyAll(); try { wait(1000); } catch (InterruptedException ex) { throw new java.io.InterruptedIOException(); } } int ret = buffer[out++] & 0xFF; if (out >= buffer.length) { out = 0; } if (in == out) { in = -1; } return ret; } NoClosePipedInputStream(NoClosePipedOutputStream src);  NoClosePipedInputStream(NoClosePipedOutputStream src, int pipeSize);  NoClosePipedInputStream();  NoClosePipedInputStream(int pipeSize); void connect(NoClosePipedOutputStream src); synchronized int read(); synchronized int read(byte b[], int off, int len); synchronized int available(); }
NoClosePipedInputStream extends InputStream { public synchronized int read() throws IOException { if (!connected) { throw new IOException("Pipe not connected"); } while (in < 0) { notifyAll(); try { wait(1000); } catch (InterruptedException ex) { throw new java.io.InterruptedIOException(); } } int ret = buffer[out++] & 0xFF; if (out >= buffer.length) { out = 0; } if (in == out) { in = -1; } return ret; } NoClosePipedInputStream(NoClosePipedOutputStream src);  NoClosePipedInputStream(NoClosePipedOutputStream src, int pipeSize);  NoClosePipedInputStream();  NoClosePipedInputStream(int pipeSize); void connect(NoClosePipedOutputStream src); synchronized int read(); synchronized int read(byte b[], int off, int len); synchronized int available();  }