<p>
Converts an array of primitive chars to objects.
</p>

<p>
This method returns {@code null} for a {@code null} input array.
</p>

@param a
a {@code char} array
@return a {@code Character} array, {@code null} if null array input
352939
@SafeVarargs
    public static Character[] box(final char... a) {
        if (a == null) {
            return null;
        }

        return box(a, 0, a.length);
    }
907479
private static String join(long[] a) {
    assert (a.length > 0);
    StringBuilder builder = new StringBuilder();
    builder.append(a[0]);
    for (int i = 1; i < a.length; ++i) {
      builder.append(',');
      builder.append(a[i]);
    }
    return builder.toString();
  }
452540
@Override
    @SuppressWarnings("unchecked")
    public <E> E[] toArray(E[] a) {

        if (a.length < size()) {
            a = (E[]) Array.newInstance(a.getClass().getComponentType(), size());
        }

        int aIndex = 0;
        synchronized (this) {

            synchronized (lock) {
                //First add anything in the expedited buffer
                //Check if we wrap around the end of the array before iterating
                if (expeditedPutIndex > expeditedTakeIndex) {
                    for (int i = expeditedTakeIndex; i <= expeditedPutIndex; i++) {
                        a[aIndex] = (E) expeditedBuffer[i];
                        aIndex++;
                    }
                } else {
                    //We wrap around the array. Loop through in two passes(upper and lower)
                    for (int i = expeditedTakeIndex; i < expeditedBuffer.length; i++) {
                        a[aIndex] = (E) expeditedBuffer[i];
                        aIndex++;
                    }
                    for (int i = 0; i < expeditedPutIndex; i++) {
                        a[aIndex] = (E) expeditedBuffer[i];
                        aIndex++;
                    }
                }

                //Now add the items in the main buffer
                //Check if we wrap around the end of the array before iterating
                if (putIndex > takeIndex) {
                    for (int i = takeIndex; i <= putIndex; i++) {
                        a[aIndex] = (E) buffer[i];
                        aIndex++;
                    }
                } else {
                    //We wrap around the array. Loop through in two passes(upper and lower)
                    for (int i = takeIndex; i < buffer.length; i++) {
                        a[aIndex] = (E) buffer[i];
                        aIndex++;
                    }
                    for (int i = 0; i < putIndex; i++) {
                        a[aIndex] = (E) buffer[i];
                        aIndex++;
                    }
                }
            }
        }

        if (a.length > size()) {
            a[size()] = null;
        }
        return a;
    }
1174659
public Object parse(char [] chars) {
        if (chars == null) {
            throw new IllegalArgumentException("chars must not be null");
        }

        Object content;
        content = createParser().parse(chars);
        return content;
    }
1335751
public char[] toCharArray() {
        return collectSized(CharBuffer::new, CharBuffer::add, CharBuffer::addAll, CharBuffer::new,
            CharBuffer::addUnsafe).toArray();
    }
587658
public static <T> Level0ArrayOperator<Character[],Character> on(final char[] target) {
        return onArrayOf(Types.CHARACTER, ArrayUtils.toObject(target));
    }
670507
public static void normalization(char[] charArray)
    {
        assert charArray != null;
        for (int i = 0; i < charArray.length; i++)
        {
            charArray[i] = CONVERT[charArray[i]];
        }
    }
1269199
@Sensitive
    public char[] getChars() {
        if (_password != null) {
            if (_password.length != 0) {
                char[] result = new char[_password.length];
                System.arraycopy(_password, 0, result, 0, _password.length);
                return result;
            } else {
                return _password; // Can safely return the empty array - caller
                // can't change it!
            }
        } else {
            return null;
        }
    }
955154
public static FastStr of(char[] ca) {
        if (ca.length == 0) return EMPTY_STR;
        char[] newArray = new char[ca.length];
        System.arraycopy(ca, 0, newArray, 0, ca.length);
        return new FastStr(ca);
    }
1078826
@SafeVarargs
    public static Integer[] box(final int... a) {
        if (a == null) {
            return null;
        }

        return box(a, 0, a.length);
    }
32519
@Nullable
  public static char [] getAllCharacters (@Nullable @WillClose final Reader aReader)
  {
    if (aReader == null)
      return null;

    return getCopy (aReader).getAsCharArray ();
  }
828721
public static char[] unWrap(Character... values) {
		if (null == values) {
			return null;
		}
		final int length = values.length;
		if (0 == length) {
			return new char[0];
		}

		char[] array = new char[length];
		for (int i = 0; i < length; i++) {
			array[i] = values[i].charValue();
		}
		return array;
	}
957351
final static public String[] toStrings(char[][] array)
	{
		if (array == null)
		{
			return NO_STRINGS;
		}
		int length = array.length;
		if (length == 0)
		{
			return NO_STRINGS;
		}
		String[] result = new String[length];
		for (int i = 0; i < length; i++)
		{
			result[i] = new String(array[i]);
		}
		return result;
	}
798422
public static byte []
fromString(String str) {
	ByteArrayOutputStream bs = new ByteArrayOutputStream();
	byte [] raw = str.getBytes();
	for (int i = 0; i < raw.length; i++) {
		if (!Character.isWhitespace((char)raw[i]))
			bs.write(raw[i]);
	}
	byte [] in = bs.toByteArray();
	if (in.length % 2 != 0) {
		return null;
	}

	bs.reset();
	DataOutputStream ds = new DataOutputStream(bs);

	for (int i = 0; i < in.length; i += 2) {
		byte high = (byte) Base16.indexOf(Character.toUpperCase((char)in[i]));
		byte low = (byte) Base16.indexOf(Character.toUpperCase((char)in[i+1]));
		try {
			ds.writeByte((high << 4) + low);
		}
		catch (IOException e) {
		}
	}
	return bs.toByteArray();
}
748582
public char[] toCharArray() {
	Entity e = root;
	char[] chrs = new char[size()];
	int off = 0;
	while (e.next != null) {
	    e = e.next;
	    System.arraycopy(e.data, 0, chrs, off, e.data.length);
	    off += e.data.length;
	}
	System.arraycopy(buffer, 0, chrs, off, pos);
	return chrs;
    }
88375
@Override
	public char[] getTextCharacters(int[] poslen) {
		String text = getText();
		if (text == null) {
			poslen[0] = -1;
			poslen[1] = -1;
			return null;
		}
		char[] result = text.toCharArray();
		poslen[0] = 0;
		poslen[1] = result.length;
		return result;
	}
1093087
static char[] toCharArray(final CharSequence cs) {
        if (cs instanceof String) {
            return ((String) cs).toCharArray();
        }
        final int sz = cs.length();
        final char[] array = new char[cs.length()];
        for (int i = 0; i < sz; i++) {
            array[i] = cs.charAt(i);
        }
        return array;
    }