decode

Convenience method that decodes bytes in this charset into Unicode characters.

An invocation of this method upon a charset cs returns the same result as the expression

{@snippet lang=java :

  • cs.newDecoder()
  •   .onMalformedInput(CodingErrorAction.REPLACE)
  •   .onUnmappableCharacter(CodingErrorAction.REPLACE)
  •   .decode(bb);
  • }

except that it is potentially more efficient because it can cache decoders between successive invocations.

This method always replaces malformed-input and unmappable-character sequences with this charset's default replacement byte array. In order to detect such sequences, use the method directly.

Return

A char buffer containing the decoded characters

Parameters

bb

The byte buffer to be decoded