@Test public void testSetEncodingOnOutputStream() throws Exception { handler = new ConsoleHandler(Target.CONSOLE, NO_FORMATTER); handler.setErrorManager(AssertingErrorManager.of()); handler.setWriter(out); handler.setEncoding("UTF-8"); assertThat(handler.getEncoding(), is("UTF-8")); handler.publish(new ExtLogRecord(Level.INFO, "Hello World", getClass().getName())); assertThat(out.toString(), is("Hello World")); }
public void setWriter(final Writer writer) { synchronized (outputLock) { super.setWriter(writer); final OutputStream oldStream = this.outputStream; outputStream = null; safeFlush(oldStream); safeClose(oldStream); } }
OutputStreamHandler extends WriterHandler { public void setWriter(final Writer writer) { synchronized (outputLock) { super.setWriter(writer); final OutputStream oldStream = this.outputStream; outputStream = null; safeFlush(oldStream); safeClose(oldStream); } } }
OutputStreamHandler extends WriterHandler { public void setWriter(final Writer writer) { synchronized (outputLock) { super.setWriter(writer); final OutputStream oldStream = this.outputStream; outputStream = null; safeFlush(oldStream); safeClose(oldStream); } } OutputStreamHandler();  OutputStreamHandler(final Formatter formatter);  OutputStreamHandler(final OutputStream outputStream, final Formatter formatter); }
OutputStreamHandler extends WriterHandler { public void setWriter(final Writer writer) { synchronized (outputLock) { super.setWriter(writer); final OutputStream oldStream = this.outputStream; outputStream = null; safeFlush(oldStream); safeClose(oldStream); } } OutputStreamHandler();  OutputStreamHandler(final Formatter formatter);  OutputStreamHandler(final OutputStream outputStream, final Formatter formatter); Charset getCharset(); void setWriter(final Writer writer); void setOutputStream(final OutputStream outputStream); }
OutputStreamHandler extends WriterHandler { public void setWriter(final Writer writer) { synchronized (outputLock) { super.setWriter(writer); final OutputStream oldStream = this.outputStream; outputStream = null; safeFlush(oldStream); safeClose(oldStream); } } OutputStreamHandler();  OutputStreamHandler(final Formatter formatter);  OutputStreamHandler(final OutputStream outputStream, final Formatter formatter); Charset getCharset(); void setWriter(final Writer writer); void setOutputStream(final OutputStream outputStream);  }