//-----------------------------------------------------------------------
public void testWrite_charSequenceToOutputStream_Encoding() throws Exception {
CharSequence csq = new StringBuilder(new String(inData, "US-ASCII"));
ByteArrayOutputStream baout = new ByteArrayOutputStream();
YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
IOUtils.write(csq, out, "UTF16");
out.off();
out.flush();
byte[] bytes = baout.toByteArray();
bytes = new String(bytes, "UTF16").getBytes("US-ASCII");
assertTrue("Content differs", Arrays.equals(inData, bytes));
}