@Test(expected = IOException.class) public void failedAvailable() throws Exception { failedReleasableInputStream.available(); assertTrue(wasCalled.get()); }
@Override public int available() throws IOException { try { return delegate.available(); } catch (IOException e) { safeClose(); throw e; } }
ReleasableInputStream extends InputStream { @Override public int available() throws IOException { try { return delegate.available(); } catch (IOException e) { safeClose(); throw e; } } }
ReleasableInputStream extends InputStream { @Override public int available() throws IOException { try { return delegate.available(); } catch (IOException e) { safeClose(); throw e; } } ReleasableInputStream(InputStream delegate, Runnable onClose); }
ReleasableInputStream extends InputStream { @Override public int available() throws IOException { try { return delegate.available(); } catch (IOException e) { safeClose(); throw e; } } ReleasableInputStream(InputStream delegate, Runnable onClose); @Override int read(); @Override int read(byte[] bytes); @Override int read(byte[] bytes, int i, int i1); @Override long skip(long l); @Override int available(); @Override void close(); @Override void mark(int i); @Override void reset(); @Override boolean markSupported(); }
ReleasableInputStream extends InputStream { @Override public int available() throws IOException { try { return delegate.available(); } catch (IOException e) { safeClose(); throw e; } } ReleasableInputStream(InputStream delegate, Runnable onClose); @Override int read(); @Override int read(byte[] bytes); @Override int read(byte[] bytes, int i, int i1); @Override long skip(long l); @Override int available(); @Override void close(); @Override void mark(int i); @Override void reset(); @Override boolean markSupported();  }