@Test(expected = UnsupportedEncodingException.class) public void exceptions_in_flush() throws IOException { final OutputStreamWriter osw = new OutputStreamWriter(new ByteArrayOutputStream()) { @Override public void flush() throws IOException { throw new UnsupportedEncodingException("Bah"); } }; try (ProxyWriter proxy = new ProxyWriter(osw)) { proxy.flush(); } }
@Test public void appendCharSequence_with_offset() throws Exception { final StringBuilderWriter writer = new StringBuilderWriter(); final ProxyWriter proxy = new ProxyWriter(writer); proxy.append("ABC", 1, 3); proxy.flush(); assertEquals("BC", writer.toString()); proxy.close(); }
@Override public void flush() throws IOException { super.flush(); branch.flush(); }
@Override public void flush() throws IOException { super.flush(); branch.flush(); }