@Test public void testAvailable() throws Exception { final byte[] input = new byte[] {'a', 'b', 'c'}; final ByteArrayInputStream inputStream = new ByteArrayInputStream(input); final SessionInputBuffer inBuffer = new SessionInputBufferImpl(new BasicHttpTransportMetrics(), 16, 16, 1024, null); final IdentityInputStream in = new IdentityInputStream(inBuffer, inputStream); in.read(); Assert.assertEquals(2, in.available()); in.close(); }
@Override public int available() throws IOException { if (this.closed) { return 0; } final int n = this.buffer.length(); return n > 0 ? n : this.inputStream.available(); }
IdentityInputStream extends InputStream { @Override public int available() throws IOException { if (this.closed) { return 0; } final int n = this.buffer.length(); return n > 0 ? n : this.inputStream.available(); } }
IdentityInputStream extends InputStream { @Override public int available() throws IOException { if (this.closed) { return 0; } final int n = this.buffer.length(); return n > 0 ? n : this.inputStream.available(); } IdentityInputStream(final SessionInputBuffer buffer, final InputStream inputStream); }
IdentityInputStream extends InputStream { @Override public int available() throws IOException { if (this.closed) { return 0; } final int n = this.buffer.length(); return n > 0 ? n : this.inputStream.available(); } IdentityInputStream(final SessionInputBuffer buffer, final InputStream inputStream); @Override int available(); @Override void close(); @Override int read(); @Override int read(final byte[] b, final int off, final int len); }
IdentityInputStream extends InputStream { @Override public int available() throws IOException { if (this.closed) { return 0; } final int n = this.buffer.length(); return n > 0 ? n : this.inputStream.available(); } IdentityInputStream(final SessionInputBuffer buffer, final InputStream inputStream); @Override int available(); @Override void close(); @Override int read(); @Override int read(final byte[] b, final int off, final int len);  }