/** * Converts the specified Unicode code point into a UTF-16 encoded sequence * and returns it as a char array. * * @param codePoint * the Unicode code point to encode. * @return the UTF-16 encoded char sequence. If {@code codePoint} is a * {@link #isSupplementaryCodePoint(int) supplementary code point}, * then the returned array contains two characters, otherwise it * contains just one character. * @throws IllegalArgumentException if {@code codePoint} is not a valid code point. * @since 1.5 */ public static char[] toChars(int codePoint) { checkValidCodePoint(codePoint); if (isSupplementaryCodePoint(codePoint)) { int cpPrime = codePoint - 0x10000; int high = 0xD800 | ((cpPrime >> 10) & 0x3FF); int low = 0xDC00 | (cpPrime & 0x3FF); return new char[] { (char) high, (char) low }; } return new char[] { (char) codePoint }; }
checkValidCodePoint(codePoint); if (dst == null) { throw new NullPointerException("dst == null");
checkValidCodePoint(codePoint); if (getType(codePoint) == Character.UNASSIGNED) { return null;
/** * Converts the specified Unicode code point into a UTF-16 encoded sequence * and returns it as a char array. * * @param codePoint * the Unicode code point to encode. * @return the UTF-16 encoded char sequence. If {@code codePoint} is a * {@link #isSupplementaryCodePoint(int) supplementary code point}, * then the returned array contains two characters, otherwise it * contains just one character. * @throws IllegalArgumentException if {@code codePoint} is not a valid code point. * @since 1.5 */ public static char[] toChars(int codePoint) { checkValidCodePoint(codePoint); if (isSupplementaryCodePoint(codePoint)) { int cpPrime = codePoint - 0x10000; int high = 0xD800 | ((cpPrime >> 10) & 0x3FF); int low = 0xDC00 | (cpPrime & 0x3FF); return new char[] { (char) high, (char) low }; } return new char[] { (char) codePoint }; }
/** * Converts the specified Unicode code point into a UTF-16 encoded sequence * and returns it as a char array. * * @param codePoint * the Unicode code point to encode. * @return the UTF-16 encoded char sequence. If {@code codePoint} is a * {@link #isSupplementaryCodePoint(int) supplementary code point}, * then the returned array contains two characters, otherwise it * contains just one character. * @throws IllegalArgumentException if {@code codePoint} is not a valid code point. * @since 1.5 */ public static char[] toChars(int codePoint) { checkValidCodePoint(codePoint); if (isSupplementaryCodePoint(codePoint)) { int cpPrime = codePoint - 0x10000; int high = 0xD800 | ((cpPrime >> 10) & 0x3FF); int low = 0xDC00 | (cpPrime & 0x3FF); return new char[] { (char) high, (char) low }; } return new char[] { (char) codePoint }; }
/** * Converts the specified Unicode code point into a UTF-16 encoded sequence * and returns it as a char array. * * @param codePoint * the Unicode code point to encode. * @return the UTF-16 encoded char sequence. If {@code codePoint} is a * {@link #isSupplementaryCodePoint(int) supplementary code point}, * then the returned array contains two characters, otherwise it * contains just one character. * @throws IllegalArgumentException if {@code codePoint} is not a valid code point. * @since 1.5 */ public static char[] toChars(int codePoint) { checkValidCodePoint(codePoint); if (isSupplementaryCodePoint(codePoint)) { int cpPrime = codePoint - 0x10000; int high = 0xD800 | ((cpPrime >> 10) & 0x3FF); int low = 0xDC00 | (cpPrime & 0x3FF); return new char[] { (char) high, (char) low }; } return new char[] { (char) codePoint }; }
/** * Converts the specified Unicode code point into a UTF-16 encoded sequence * and returns it as a char array. * * @param codePoint * the Unicode code point to encode. * @return the UTF-16 encoded char sequence. If {@code codePoint} is a * {@link #isSupplementaryCodePoint(int) supplementary code point}, * then the returned array contains two characters, otherwise it * contains just one character. * @throws IllegalArgumentException if {@code codePoint} is not a valid code point. * @since 1.5 */ public static char[] toChars(int codePoint) { checkValidCodePoint(codePoint); if (isSupplementaryCodePoint(codePoint)) { int cpPrime = codePoint - 0x10000; int high = 0xD800 | ((cpPrime >> 10) & 0x3FF); int low = 0xDC00 | (cpPrime & 0x3FF); return new char[] { (char) high, (char) low }; } return new char[] { (char) codePoint }; }
/** * Converts the specified Unicode code point into a UTF-16 encoded sequence * and returns it as a char array. * * @param codePoint * the Unicode code point to encode. * @return the UTF-16 encoded char sequence. If {@code codePoint} is a * {@link #isSupplementaryCodePoint(int) supplementary code point}, * then the returned array contains two characters, otherwise it * contains just one character. * @throws IllegalArgumentException if {@code codePoint} is not a valid code point. * @since 1.5 */ public static char[] toChars(int codePoint) { checkValidCodePoint(codePoint); if (isSupplementaryCodePoint(codePoint)) { int cpPrime = codePoint - 0x10000; int high = 0xD800 | ((cpPrime >> 10) & 0x3FF); int low = 0xDC00 | (cpPrime & 0x3FF); return new char[] { (char) high, (char) low }; } return new char[] { (char) codePoint }; }
/** * Converts the specified Unicode code point into a UTF-16 encoded sequence * and returns it as a char array. * * @param codePoint * the Unicode code point to encode. * @return the UTF-16 encoded char sequence. If {@code codePoint} is a * {@link #isSupplementaryCodePoint(int) supplementary code point}, * then the returned array contains two characters, otherwise it * contains just one character. * @throws IllegalArgumentException if {@code codePoint} is not a valid code point. * @since 1.5 */ public static char[] toChars(int codePoint) { checkValidCodePoint(codePoint); if (isSupplementaryCodePoint(codePoint)) { int cpPrime = codePoint - 0x10000; int high = 0xD800 | ((cpPrime >> 10) & 0x3FF); int low = 0xDC00 | (cpPrime & 0x3FF); return new char[] { (char) high, (char) low }; } return new char[] { (char) codePoint }; }
checkValidCodePoint(codePoint); if (dst == null) { throw new NullPointerException("dst == null");
checkValidCodePoint(codePoint); if (dst == null) { throw new NullPointerException("dst == null");
checkValidCodePoint(codePoint); if (dst == null) { throw new NullPointerException("dst == null");
checkValidCodePoint(codePoint); if (dst == null) { throw new NullPointerException("dst == null");
checkValidCodePoint(codePoint); if (dst == null) { throw new NullPointerException("dst == null");
checkValidCodePoint(codePoint); if (getType(codePoint) == Character.UNASSIGNED) { return null;
checkValidCodePoint(codePoint); if (getType(codePoint) == Character.UNASSIGNED) { return null;
checkValidCodePoint(codePoint); if (getType(codePoint) == Character.UNASSIGNED) { return null;
checkValidCodePoint(codePoint); if (getType(codePoint) == Character.UNASSIGNED) { return null;
checkValidCodePoint(codePoint); if (getType(codePoint) == Character.UNASSIGNED) { return null;
checkValidCodePoint(codePoint); if (getType(codePoint) == Character.UNASSIGNED) { return null;