protected final void storeContentCharacters(int type, char[] ch, int start, int length) { if (_contentCharactersBufferPtr + length >= _contentCharactersBuffer.length) { if (length >= 512) { storeStructure(type | CONTENT_TYPE_CHAR_ARRAY_COPY); storeContentCharactersCopy(ch, start, length); return; } resizeContentCharacters(); } if (length < CHAR_ARRAY_LENGTH_SMALL_SIZE) { storeStructure(type); storeStructure(length); System.arraycopy(ch, start, _contentCharactersBuffer, _contentCharactersBufferPtr, length); _contentCharactersBufferPtr += length; } else if (length < CHAR_ARRAY_LENGTH_MEDIUM_SIZE) { storeStructure(type | CHAR_ARRAY_LENGTH_MEDIUM); storeStructure(length >> 8); storeStructure(length & 255); System.arraycopy(ch, start, _contentCharactersBuffer, _contentCharactersBufferPtr, length); _contentCharactersBufferPtr += length; } else { storeStructure(type | CONTENT_TYPE_CHAR_ARRAY_COPY); storeContentCharactersCopy(ch, start, length); } }