Example usage for java.lang Character lowSurrogate

List of usage examples for java.lang Character lowSurrogate

Introduction

In this page you can find the example usage for java.lang Character lowSurrogate.

Prototype

public static char lowSurrogate(int codePoint) 

Source Link

Document

Returns the trailing surrogate (a <a href="http://www.unicode.org/glossary/#low_surrogate_code_unit"> low surrogate code unit</a>) of the <a href="http://www.unicode.org/glossary/#surrogate_pair"> surrogate pair</a> representing the specified supplementary character (Unicode code point) in the UTF-16 encoding.

Usage

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);
    }
}