OutputStreamWriter extends Writer { @Override public void flush() throws IOException { _ensureOpen(); _flushBuffer(); _outputStream.flush(); } OutputStreamWriter(OutputStream outputStream);  OutputStreamWriter(OutputStream outputStream, String charsetName);  OutputStreamWriter(
		OutputStream outputStream, String charsetName, boolean autoFlush);  OutputStreamWriter(
		OutputStream outputStream, String charsetName, int outputBufferSize);  OutputStreamWriter(
		OutputStream outputStream, String charsetName, int outputBufferSize,
		boolean autoFlush); @Override void close(); @Override void flush(); String getEncoding(); @Override void write(char[] chars); @Override void write(char[] chars, int offset, int length); @Override void write(int c); @Override void write(String string); @Override void write(String string, int offset, int length);  }
@Test public void testFlush() throws IOException { MarkerOutputStream markerOutputStream = new MarkerOutputStream(); OutputStreamWriter outputStreamWriter = new OutputStreamWriter( markerOutputStream); Assert.assertFalse(markerOutputStream._flushed); outputStreamWriter.flush(); Assert.assertTrue(markerOutputStream._flushed); outputStreamWriter.write('a'); outputStreamWriter.flush(); Assert.assertTrue(markerOutputStream._flushed); }