buf.flip();
assertEquals("hello", buf.getString(charset.newDecoder()));
buf.clear();
buf.putString("hello", charset.newEncoder());
buf.flip();
assertEquals("hello", buf.getString(charset.newDecoder()));
decoder = Charset.forName("ISO-8859-1").newDecoder();
buf.clear();
buf.put((byte) 'A');