char[] chars = ThreadLocalCache.getChars(scaleLength);
CharBuffer charBuffer = CharBuffer.wrap(chars);
IOUtils.decode(charsetDecoder, ByteBuffer.wrap(bytes), charBuffer);
charsetDecoder.decode(ByteBuffer.wrap(bytes), charBuffer, true);
int position = charBuffer.position();
Assert.assertEquals(content, new String(chars, 0, position));
}