Transforms any array into an array of {@code Character}.
@param src source array
@param srcPos start position
@param len length
@return Character array
9231
public static Character[] boxCharacters(Object src, int srcPos, int len) {
        return boxCharacters(array(src), srcPos, len);
    }
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);
        }
    }
1138003
public static byte[] decodeFromString(String src) {
		if (src == null) {
			return null;
		}
		if (src.length() == 0) {
			return new byte[0];
		}
		byte[] result;
		try {
			result = delegate.decode(src.getBytes(DEFAULT_CHARSET.displayName()));
		} catch (UnsupportedEncodingException e) {
			// should not happen, UTF-8 is always supported
			throw new IllegalStateException(e);
		}
		return result;
	}
166192
public StrBuilder getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) {
		if (srcBegin < 0) {
			srcBegin = 0;
		}
		if (srcEnd < 0) {
			srcEnd = 0;
		} else if (srcEnd > this.position) {
			srcEnd = this.position;
		}
		if (srcBegin > srcEnd) {
			throw new StringIndexOutOfBoundsException("srcBegin > srcEnd");
		}
		System.arraycopy(value, srcBegin, dst, dstBegin, srcEnd - srcBegin);
		return this;
	}
739383
public static char decodeCharDesc(byte[] src, int srcOffset)
        throws CorruptEncodingException
    {
        try {
            return (char)~((src[srcOffset] << 8) | (src[srcOffset + 1] & 0xff));
        } catch (IndexOutOfBoundsException e) {
            throw new CorruptEncodingException(null, e);
        }
    }
507015
public char charAt(int pos)
  {
    int startChunk = pos >>> m_chunkBits;

    if (startChunk == 0 && m_innerFSB != null)
      return m_innerFSB.charAt(pos & m_chunkMask);
    else
      return m_array[startChunk][pos & m_chunkMask];
  }
769550
public static byte[] decode(char[] src) {
        byte[] dst = new byte[src.length / 2];

        for (int si = 0, di = 0; di < dst.length; di++) {
            byte high = decode[src[si++] & 0x7f];
            byte low  = decode[src[si++] & 0x7f];
            dst[di] = (byte) ((high << 4) + low);
        }

        return dst;
    }
1369415
public void characters(final char[] ch, final int start, final int length) throws SAXException {
        charBuffer.append(ch, start, length);
    }
1319130
public static Characters of(char... chars) {
        return chars.length == 0 ? Characters.NONE : new Characters(false, chars.clone());
    }
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;
    }
1039718
private static String decodeString(ByteBuffer src) throws CharacterCodingException
    {
        // the decoder needs to be reset every time we use it, hence the copy per thread
        CharsetDecoder theDecoder = decoder.get();
        theDecoder.reset();

        final CharBuffer dst = CharBuffer.allocate(
                (int) ((double) src.remaining() * theDecoder.maxCharsPerByte()));

        CoderResult cr = theDecoder.decode(src, dst, true);
        if (!cr.isUnderflow())
            cr.throwException();

        cr = theDecoder.flush(dst);
        if (!cr.isUnderflow())
            cr.throwException();

        return dst.flip().toString();
    }
1046524
static String toChars(String p) {
      if (p.length() >= 3 && p.charAt(0) == '[' && p.charAt(p.length() - 1) == ']') {
         return p.substring(1, p.length() - 1);
      }
      return p;
   }
716188
public static Character parserCharacter(JsonPullParser parser) throws IOException,
			JsonFormatException {

		State eventType = parser.getEventType();
		if (eventType == State.VALUE_NULL) {
			return null;
		} else if (eventType == State.VALUE_STRING) {
			String str = parser.getValueString();
			if (str.length() != 1) {
				throw new IllegalStateException(
						"unexpected value. expecte string size is 1. but get=" + str);
			}
			return str.charAt(0);
		} else {
			throw new IllegalStateException("unexpected state. expected=VALUE_STRING, but get="
					+ eventType.toString());
		}
	}
1261095
public static int[] flip(int[] src, int[] dest, final int start, final int length)
	{
		if (dest == null || dest.length < length)
			dest = new int[length];

		int srcIndex = start + length;
		for (int i = 0; i < length; i++)
		{
			dest[i] = src[--srcIndex];
		}

		return dest;
	}
1066167
public static void copy(final Object src, final int srcPos, final Object dest, final int destPos, final int length) {
        if (Array.getLength(src) < srcPos + length) {
            throw new IllegalArgumentException("The size of src array less than " + (srcPos + length));
        }

        if (Array.getLength(dest) < destPos + length) {
            throw new IllegalArgumentException("The size of dest array less than " + (destPos + length));
        }

        System.arraycopy(src, srcPos, dest, destPos, length);
    }
148258
public static Object copy(Object src, int srcPos, Object dest, int destPos, int length) {
		System.arraycopy(src, srcPos, dest, destPos, length);
		return dest;
	}
393371
public static long decodeLong(byte[] src, int srcOffset)
        throws CorruptEncodingException
    {
        try {
            return
                (((long)(((src[srcOffset    ]       ) << 24) |
                         ((src[srcOffset + 1] & 0xff) << 16) |
                         ((src[srcOffset + 2] & 0xff) << 8 ) |
                         ((src[srcOffset + 3] & 0xff)      )) ^ 0x80000000 ) << 32) |
                (((long)(((src[srcOffset + 4]       ) << 24) |
                         ((src[srcOffset + 5] & 0xff) << 16) |
                         ((src[srcOffset + 6] & 0xff) << 8 ) |
                         ((src[srcOffset + 7] & 0xff)      )) & 0xffffffffL)      );
        } catch (IndexOutOfBoundsException e) {
            throw new CorruptEncodingException(null, e);
        }
    }