@Test
public void testWriteChars() throws IOException {

    UnsafeByteArrayOutputStream os = new UnsafeByteArrayOutputStream();
    int length = os.getByteArray().length;
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < length; i++) {
        sb.append("\u10ea");
    }
    String s = sb.toString();
    os.writeChars(s);
    UnsafeByteArrayInputStream is = new UnsafeByteArrayInputStream(os.getByteArray());
    for (int i = 0; i < s.length(); i++) {
        assertEquals(s.charAt(i), is.readChar());
    }
    os.close();
}