List of usage examples for java.lang Character lowSurrogate
public static char lowSurrogate(int codePoint)
From source file:Main.java
public static void main(String[] args) { int cp1 = 0x001c; // represents FILE SEPARATOR int cp2 = 0x0abc; System.out.println(Character.lowSurrogate(cp1)); System.out.println(Character.lowSurrogate(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 {/*from w w w . j a v a 2 s . c o m*/ 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.//w ww . ja v a 2s .c om * * @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); } }