code: public static String decode(byte[] bytes, Charset charset)
      {
          CharsetDecoder decoder = charset.newDecoder();
          try
          {
              CharBuffer buffer = decoder.decode(ByteBuffer.wrap(bytes));
              return buffer.toString();
          }
          catch (CharacterCodingException e)
          {
              String message =
                  "Input is not valid " + charset.displayName() + " data";
              throw new IonException(message, e);
          }
      }
docs: Decodes a byte sequence into a string, given a {@link Charset}.
  <p>
  This method is preferred to {@link Charset#decode(ByteBuffer)} and
  {@link String#String(byte[], Charset)} (<em>etc.</em>)
  since those methods will replace or ignore bad input, and here we throw
  an exception.
  
  @param bytes the data to decode.
  
  @return the decoded string, not null.
  
  @throws IonException if there's a {@link CharacterCodingException}.