@Test public void testNegativeInAvailable() throws IOException { in.in = -1; assertEquals(0, in.available()); }
public synchronized int available() throws IOException { if(in < 0) return 0; else if(in == out) return buffer.length; else if (in > out) return in - out; else return in + buffer.length - out; }
NoClosePipedInputStream extends InputStream { public synchronized int available() throws IOException { if(in < 0) return 0; else if(in == out) return buffer.length; else if (in > out) return in - out; else return in + buffer.length - out; } }
NoClosePipedInputStream extends InputStream { public synchronized int available() throws IOException { if(in < 0) return 0; else if(in == out) return buffer.length; else if (in > out) return in - out; else return in + buffer.length - out; } NoClosePipedInputStream(NoClosePipedOutputStream src);  NoClosePipedInputStream(NoClosePipedOutputStream src, int pipeSize);  NoClosePipedInputStream();  NoClosePipedInputStream(int pipeSize); }
NoClosePipedInputStream extends InputStream { public synchronized int available() throws IOException { if(in < 0) return 0; else if(in == out) return buffer.length; else if (in > out) return in - out; else return in + buffer.length - out; } 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 available() throws IOException { if(in < 0) return 0; else if(in == out) return buffer.length; else if (in > out) return in - out; else return in + buffer.length - out; } 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();  }