public static int append ( char [ ] target , int limit , int char32 ) { // Check for irregular values if ( char32 < CODEPOINT_MIN_VALUE || char32 > CODEPOINT_MAX_VALUE ) { throw new IllegalArgumentException ( "Illegal codepoint" ) ; } // Write the UTF-16 values if ( char32 >= SUPPLEMENTARY_MIN_VALUE ) { target [ limit ++ ] = getLeadSurrogate ( char32 ) ; target [ limit ++ ] = getTrailSurrogate ( char32 ) ; } else { target [ limit ++ ] = ( char ) char32 ; } return limit ; }
Adds a codepoint to offset16 position of the argument char array .