Transforms any array into an array of {@code char}.
@param src source array
@param srcPos start position
@param len length
@return char array
17402
public static char[] unboxCharacters(Object src, int srcPos, int len) {
        return unboxCharacters(array(src), srcPos, len);
    }
372323
public static CharBuffer bytesToChars(CharsetDecoder decoder, ByteBuffer bytes, CharBuffer chars) {
    assert decoder.malformedInputAction() == CodingErrorAction.REPORT;

    chars = clearAndEnsureCapacity(chars, (int) (bytes.remaining() * decoder.maxCharsPerByte()));

    bytes.mark();
    decoder.reset();
    CoderResult cr = decoder.decode(bytes, chars, true);
    if (cr.isError()) {
      bytes.reset();
      try {
        cr.throwException();
      } catch (CharacterCodingException e) {
        throw new RuntimeException("Input cannot be mapped to bytes using encoding "
            + decoder.charset().name() + ": " + Arrays.toString(toArray(bytes)), e);
      }
    }

    assert cr.isUnderflow();  // This should be guaranteed by ensuring max. capacity.
    cr = decoder.flush(chars);
    assert cr.isUnderflow();

    chars.flip();
    bytes.reset();

    return chars;
  }
1007248
public char[] toCharArray()
    {
        // check if there is a cached single charbuffer
        if (firstChunk == lastChunk && firstChunk instanceof CharBufferChunk
                && allocBuffer.charsUsed() == 0
                && ((CharBufferChunk) firstChunk).isSingleBuffer())
        {
            return ((CharBufferChunk) firstChunk).buffer;
        }

        int initialReaderCount = readerCount;
        char[] buf = readAsCharArray();
        if (initialReaderCount == 0)
        {
            // if there are no readers, the result can be cached
            reset();
            if (buf.length > 0)
            {
                addChunk(new CharBufferChunk(-1, buf, 0, buf.length));
            }
        }
        return buf;
    }
206907
public static Character decodeCharacterObjDesc(byte[] src, int srcOffset)
        throws CorruptEncodingException
    {
        try {
            int b = src[srcOffset];
            if (b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW) {
                return null;
            }
            return decodeCharDesc(src, srcOffset + 1);
        } catch (IndexOutOfBoundsException e) {
            throw new CorruptEncodingException(null, e);
        }
    }
872838
public static Object unboxAll(Object[] src, int srcPos, int len) {
        if (srcPos >= src.length) {
            throw new IndexOutOfBoundsException(String.valueOf(srcPos));
        }
        Class<?> type = src[srcPos].getClass();
        return unboxAll(type, src, srcPos, len);
    }
213870
public static Short[] boxShorts(Object src, int srcPos, int len) {
        return boxShorts(array(src), srcPos, len);
    }
507397
public static long[] unboxLongs(Object src, int srcPos, int len) {
        return unboxLongs(array(src), srcPos, len);
    }
34768
public final int toCodePoints(char[] src, int srcOff, int srcLen, int[] dest, int destOff) {
    if (srcLen < 0) {
      throw new IllegalArgumentException("srcLen must be >= 0");
    }
    int codePointCount = 0;
    for (int i = 0; i < srcLen; ) {
      final int cp = codePointAt(src, srcOff + i, srcOff + srcLen);
      final int charCount = Character.charCount(cp);
      dest[destOff + codePointCount++] = cp;
      i += charCount;
    }
    return codePointCount;
  }
1147078
public static Object[] boxAll(Class<?> type, Object src, int srcPos, int len) {
        switch (tId(type)) {
            case I_BOOLEAN:     return boxBooleans(src, srcPos, len);
            case I_BYTE:        return boxBytes(src, srcPos, len);
            case I_CHARACTER:   return boxCharacters(src, srcPos, len);
            case I_DOUBLE:      return boxDoubles(src, srcPos, len);
            case I_FLOAT:       return boxFloats(src, srcPos, len);
            case I_INTEGER:     return boxIntegers(src, srcPos, len);
            case I_LONG:        return boxLongs(src, srcPos, len);
            case I_SHORT:       return boxShorts(src, srcPos, len);
        }
        throw new IllegalArgumentException("No primitive/box: " + type);
    }
1207917
public StrBuilder insert(int index, char[] src, int srcPos, int length) {
		if (ArrayUtil.isEmpty(src) || srcPos > src.length || length <= 0) {
			return this;
		}
		if (index < 0) {
			index = 0;
		}
		if (srcPos < 0) {
			srcPos = 0;
		} else if (srcPos + length > src.length) {
			// 长度越界，只截取最大长度
			length = src.length - srcPos;
		}

		moveDataAfterIndex(index, length);
		// 插入数据
		System.arraycopy(src, srcPos, value, index, length);
		this.position = Math.max(this.position, index) + length;
		return this;
	}
871348
public static double[] unboxDoubles(Object src, int srcPos, int len) {
        return unboxDoubles(array(src), srcPos, len);
    }
715532
public static String[] toArray(final Vector src) {
    final String[] retval = new String[src.size()];
    src.copyInto(retval);
    return retval;
  }
1117003
public static String[] splitWithCommaOrSemicolon(String src) {
        if (isEmpty(src)) {
            return StringUtils.EMPTY_STRING_ARRAY;
        }
        String[] ss = split(src.replace(',', ';'), ";");
        List<String> list = new ArrayList<String>();
        for (String s : ss) {
            if (!isBlank(s)) {
                list.add(s.trim());
            }
        }
        return list.toArray(new String[list.size()]);
    }
380209
public void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin) {
        if (srcBegin < 0) {
            throw new StringIndexOutOfBoundsException(srcBegin);
        }
        if (srcBegin > srcEnd) {
            throw new StringIndexOutOfBoundsException(srcEnd - srcBegin);
        }
        int sz = size();
        if (srcEnd > sz) {
            throw new StringIndexOutOfBoundsException(srcEnd);
        }
        System.arraycopy(buf, toInternalId(srcBegin), dst, dstBegin, srcEnd - srcBegin);
    }
1340396
private byte[] toByteArray(char[] chars, Charset charset) {
        assert chars != null;

        CharBuffer charBuffer = CharBuffer.wrap(chars);
        ByteBuffer byteBuffer = charset.encode(charBuffer);
        byte[] bytes = Arrays.copyOfRange(byteBuffer.array(),
                byteBuffer.position(), byteBuffer.limit());
        Arrays.fill(byteBuffer.array(), (byte) 0); // clear sensitive data
        return bytes;
    }
61528
public static float[] unboxFloats(Object src, int srcPos, int len) {
        return unboxFloats(array(src), srcPos, len);
    }
378982
public char[] toCharArray() {
        // check if there is a cached single charbuffer
        if (firstChunk == lastChunk && firstChunk instanceof CharBufferChunk && allocBuffer.charsUsed()==0 && ((CharBufferChunk)firstChunk).isSingleBuffer()) {
            return ((CharBufferChunk)firstChunk).buffer;
        }

        int initialReaderCount = readerCount;
        MultipartCharBufferChunk chunk = readToSingleChunk();
        if (initialReaderCount == 0) {
            // if there are no readers, the result can be cached
            reset();
            if (chunk != null) {
                addChunk(chunk);
            }
        }
        if(chunk != null) {
            return chunk.buffer;
        } else {
            return new char[0];
        }
    }