public static String toUTF(byte[] bytes) {
    int codePoint = ByteBuffer.wrap(bytes).getInt();
    if (codePoint < 0 || codePoint > 0X10FFFF)
      throw new IllegalArgumentException(
          "RangeError: pack(U): value out of range");

    return String.valueOf((char) codePoint);
  }
public static String toUTF ( byte [ ] bytes ) { int codePoint = ByteBuffer . wrap ( bytes ) . getInt ( ) ; if ( codePoint < 0 || codePoint > 0X10FFFF ) throw new IllegalArgumentException ( "RangeError: pack(U): value out of range" ) ; return String . valueOf ( ( char ) codePoint ) ; }
Converts a byte array into an UTF String.

@param bytes
used to be converted
@return UTF String
@throws IllegalArgumentException
if codePoint is less than 0 or greater than 0X10FFFF