@Test public void testClose() throws IOException { shielded.close(); assertFalse("closed", closed); try { shielded.write('x'); fail("write(b)"); } catch (final IOException ignore) { } original.write('y'); assertEquals(1, original.size()); assertEquals('y', original.toByteArray()[0]); }
@Override public void close() { out = new ClosedOutputStream(); }
CloseShieldOutputStream extends ProxyOutputStream { @Override public void close() { out = new ClosedOutputStream(); } }
CloseShieldOutputStream extends ProxyOutputStream { @Override public void close() { out = new ClosedOutputStream(); } CloseShieldOutputStream(final OutputStream out); }
CloseShieldOutputStream extends ProxyOutputStream { @Override public void close() { out = new ClosedOutputStream(); } CloseShieldOutputStream(final OutputStream out); @Override void close(); }
CloseShieldOutputStream extends ProxyOutputStream { @Override public void close() { out = new ClosedOutputStream(); } CloseShieldOutputStream(final OutputStream out); @Override void close();  }