@Test
public void testWriteError() {

	WriterOutputStream writerOutputStream = new WriterOutputStream(
		new DummyWriter(), "US-ASCII");
	CharsetDecoder charsetDecoder = ReflectionTestUtil.getFieldValue(
		writerOutputStream, "_charsetDecoder");
	charsetDecoder.onMalformedInput(CodingErrorAction.REPORT);
	try {
		writerOutputStream.write(new byte[] {-1, -2, -3, -4});
		Assert.fail();
	}
	catch (IOException ioException) {
		Assert.assertEquals(
			"Unexcepted coder result MALFORMED[1]",
			ioException.getMessage());
	}
}