return charsetDecoder.decode(byteBuffer);
} else {
charsetDecoder.onMalformedInput(CodingErrorAction.REPORT).onUnmappableCharacter(CodingErrorAction.REPORT);
CharBuffer out = CharBuffer.allocate(contents.length);
CoderResult result = null;
String replacement = charsetDecoder.replacement();
int replacementLength = replacement.length();
EncodingErrorCollector collector = null;
while (true) {
result = charsetDecoder.decode(byteBuffer, out, true);
if (result.isMalformed() || result.isUnmappable()) {