// implement BytePointer protected byte[] getBytesForString(String string) { try { return string.getBytes(getCharsetName()); } catch (UnsupportedEncodingException ex) { throw Util.newInternal(ex); } }
// TODO: preallocate a CharsetDecoder public String toString() { if (buf == null) { return null; } try { return new String(buf, pos, count - pos, getCharsetName()); } catch (UnsupportedEncodingException ex) { throw Util.newInternal(ex); } }