@Test
public void testWrite() throws IOException {

	CharArrayWriter charArrayWriter = new CharArrayWriter();
	WriterOutputStream writerOutputStream = new WriterOutputStream(
		charArrayWriter, StringPool.UTF8, true);
	int charNumber = 0;
	String unalignedOutput = "非对齐测试中文输出";
	byte[] unalignedInput = unalignedOutput.getBytes(StringPool.UTF8);
	for (byte b : unalignedInput) {
		writerOutputStream.write(b);
		int currentCharNumber = charArrayWriter.size();
		if (currentCharNumber > charNumber) {
			charNumber = currentCharNumber;
			Assert.assertEquals(
				unalignedOutput.charAt(charNumber - 1),
				charArrayWriter.toCharArray()[charNumber - 1]);
		}
	}
	Assert.assertEquals(unalignedOutput, charArrayWriter.toString());
}