@Override public boolean moveNext() throws IOException { if (reader.next()) { String colStrValue; String[] split = reader.getRow(); if (split.length == 1) { colStrValue = split[0]; } else { // normal case if (split.length <= colIndex) { throw new ArrayIndexOutOfBoundsException( "Column no. " + colIndex + " not found, line split is " + Arrays.asList(split)); } colStrValue = split[colIndex]; } colValue = colStrValue; return true; } else { colValue = null; return false; } }
@Override public void close() throws IOException { if (reader != null) reader.close(); }