count = is.read (rawReadBuffer, 0, READ_BUFFER_MAX);
case ENCODING_UCS_2_12: copyUcs2ReadBuffer(count, 8, 0); break; case ENCODING_UCS_2_21: copyUcs2ReadBuffer(count, 0, 8); break;   case ENCODING_UCS_4_1234: copyUcs4ReadBuffer(count, 24, 16, 8, 0); break; case ENCODING_UCS_4_4321: copyUcs4ReadBuffer(count, 0, 8, 16, 24); break; case ENCODING_UCS_4_2143: copyUcs4ReadBuffer(count, 16, 24, 0, 8); break; case ENCODING_UCS_4_3412: copyUcs4ReadBuffer(count, 8, 0, 24, 16); break; } } else { readBufferLength = readBufferPos; }
    private void readDataChunk ()    throws SAXException, IOException    {	int count;	// See if we have any overflow (filterCR sets for CR at end)	if (readBufferOverflow > -1) {	    readBuffer [0] = (char) readBufferOverflow;	    readBufferOverflow = -1;	    readBufferPos = 1;	    sawCR = true;	} else {	    readBufferPos = 0;	    sawCR = false;	}	// input from a character stream.	if (sourceType == INPUT_READER) {	    count = reader.read (readBuffer,			    readBufferPos, READ_BUFFER_MAX - readBufferPos);	    if (count < 0)		readBufferLength = readBufferPos;	    else		readBufferLength = readBufferPos + count;	    if (readBufferLength > 0)		filterCR (count >= 0);	    sawCR = false;	    return;	}	// Read as many bytes as possible into the raw buffer.	count = is.read (rawReadBuffer, 0, READ_BUFFER_MAX);	// Dispatch to an encoding-specific reader method to populate	// the readBuffer.  In most parser speed profiles, these routines	// show up at the top of the CPU usage chart.	if (count > 0) {	    switch (encoding) {	      // one byte builtins	      case ENCODING_ASCII:		copyIso8859_1ReadBuffer (count, (char) 0x0080);		break;	      case ENCODING_UTF_8:		copyUtf8ReadBuffer (count);		break;	      case ENCODING_ISO_8859_1:		copyIso8859_1ReadBuffer (count, (char) 0);		break;	      // two byte builtins	      case ENCODING_UCS_2_12:		copyUcs2ReadBuffer (count, 8, 0);		break;	      case ENCODING_UCS_2_21:		copyUcs2ReadBuffer (count, 0, 8);		break;	      // four byte builtins	      case ENCODING_UCS_4_1234:		copyUcs4ReadBuffer (count, 24, 16, 8, 0);		break;	      case ENCODING_UCS_4_4321:		copyUcs4ReadBuffer (count, 0, 8, 16, 24);		break;	      case ENCODING_UCS_4_2143:		copyUcs4ReadBuffer (count, 16, 24, 0, 8);		break;	      case ENCODING_UCS_4_3412:		copyUcs4ReadBuffer (count, 8, 0, 24, 16);		break;	    }	} else	    readBufferLength = readBufferPos;	readBufferPos = 0;	// Filter out all carriage returns if we've seen any	// (including any saved from a previous read)	if (sawCR) {	    filterCR (count >= 0);	    sawCR = false;	    // must actively report EOF, lest some CRs get lost.	    if (readBufferLength == 0 && count >= 0)		readDataChunk ();	}	if (count > 0)	    currentByteCount += count;    }