protected Object[] rawReadRow(MessagePart[] partsInOrder, CSVMessagePartMapping rowMapping) throws IOException
{
Object[] result = new Object[rowMapping.getHighestOrdinal()];
int nResultIndex = 0;
char chDelimiter = rowMapping.getDelimiter().charValue();
CSVMessagePartMapping partMapping;
while (!m_bEOF && (m_chCurrent != '\n' && m_chCurrent != '\r'))
{
//Do not get more fields than necessary, if number of fields is known.
if (partsInOrder != null && nResultIndex >= result.length)
{
break;
}
if (partsInOrder != null && partsInOrder[nResultIndex] != null)
{
partMapping = (CSVMessagePartMapping)partsInOrder[nResultIndex].getMapping();
}
else
{
partMapping = rowMapping;
}
//Infer presence of data if this field starts with a delimiter
if (nResultIndex > 0 && m_chCurrent == chDelimiter)
{
//Advance to first character of data field.
if (!m_bEOF)
{
readNext();
}
}
chDelimiter = partMapping.getDelimiter().charValue();
// Resize array to accommodate data, if getting unknown number of fields
if (partsInOrder == null && nResultIndex >= result.length)
{
Object[] tmp = new Object[result.length << 1];