List of usage examples for java.lang Character highSurrogate
public static char highSurrogate(int codePoint)
From source file:Main.java
public static void main(String[] args) { int cp1 = 0x008f, cp2 = 0x0123; System.out.println(Character.highSurrogate(cp1)); System.out.println(Character.highSurrogate(cp2)); }
From source file:org.codelibs.fess.crawler.util.UnsafeStringBuilder.java
public StrBuilder appendCodePoint(int codePoint) { if (Character.isBmpCodePoint(codePoint)) { append((char) codePoint); } else if (Character.isValidCodePoint(codePoint)) { append(Character.highSurrogate(codePoint)); append(Character.lowSurrogate(codePoint)); } else {// w ww . j a v a 2 s .c om throw new IllegalArgumentException(); } return this; }
From source file:org.eclipse.rdf4j.rio.turtle.TurtleParser.java
/** * Appends the characters from codepoint into the string builder. This is * the same as Character#toChars but prevents the additional char array * garbage for BMP codepoints.// ww w.j a va2 s . c o m * * @param dst * the destination in which to append the characters * @param codePoint * the codepoint to be appended */ private static void appendCodepoint(StringBuilder dst, int codePoint) { if (Character.isBmpCodePoint(codePoint)) { dst.append((char) codePoint); } else if (Character.isValidCodePoint(codePoint)) { dst.append(Character.highSurrogate(codePoint)); dst.append(Character.lowSurrogate(codePoint)); } else { throw new IllegalArgumentException("Invalid codepoint " + codePoint); } }