code: 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;
      }
docs: Adds a codepoint to offset16 position of the argument char array.
  
  @param target Char array to be append with the new code point
  @param limit UTF16 offset which the codepoint will be appended.
  @param char32 Code point to be appended
  @return offset after char32 in the array.
  @exception IllegalArgumentException Thrown if there is not enough space for the append, or when char32 does not
  lie within the range of the Unicode codepoints.