baseScanner.startNext(); Cell cell; while ((cell = baseScanner.peekNextCell(limit)) != null && (limit <= 0 || addedCnt < limit)) {
/** * Returns the next available cell for the current row and advances the pointer to the next cell. This method * can be called multiple times in a row to advance through all the available cells. * * @param limit the limit of number of cells to return if the next batch must be fetched by the wrapped scanner * @return the next available cell or null if no more cells are available for the current row * @throws IOException */ public Cell nextCell(int limit) throws IOException { Cell cell = peekNextCell(limit); if (cell != null) { currentIdx++; } return cell; }