Index index = (Index) iter.next();
Index index = (Index) indIter.next();
  public void addRows(List rows) throws IOException {    ByteBuffer dataPage = _pageChannel.createPageBuffer();    ByteBuffer[] rowData = new ByteBuffer[rows.size()];    Iterator iter = rows.iterator();    for (int i = 0; iter.hasNext(); i++) {      rowData[i] = createRow((Object[]) iter.next());    }    List pageNumbers = _ownedPages.getPageNumbers();    int pageNumber;    int rowSize;    if (pageNumbers.size() == 0) {      //No data pages exist.  Create a new one.      pageNumber = newDataPage(dataPage, rowData[0]);    } else {      //Get the last data page.      //Not bothering to check other pages for free space.      pageNumber = ((Integer) pageNumbers.get(pageNumbers.size() - 1)).intValue();      _pageChannel.readPage(dataPage, pageNumber);    }    for (int i = 0; i < rowData.length; i++) {      rowSize = rowData[i].limit();      short freeSpaceInPage = dataPage.getShort(_format.OFFSET_FREE_SPACE);      if (freeSpaceInPage < (rowSize + _format.SIZE_ROW_LOCATION)) {        //Last data page is full.  Create a new one.        if (rowSize + _format.SIZE_ROW_LOCATION > _format.MAX_ROW_SIZE) {          throw new IOException("Row size " + rowSize + " is too large");        }        _pageChannel.writePage(dataPage, pageNumber);        dataPage.clear();        pageNumber = newDataPage(dataPage, rowData[i]);        _freeSpacePages.removePageNumber(pageNumber);        freeSpaceInPage = dataPage.getShort(_format.OFFSET_FREE_SPACE);      }      //Decrease free space record.      dataPage.putShort(_format.OFFSET_FREE_SPACE, (short) (freeSpaceInPage -          rowSize - _format.SIZE_ROW_LOCATION));      //Increment row count record.      short rowCount = dataPage.getShort(_format.OFFSET_NUM_ROWS_ON_DATA_PAGE);      dataPage.putShort(_format.OFFSET_NUM_ROWS_ON_DATA_PAGE, (short) (rowCount + 1));      short rowLocation = (short) _format.PAGE_SIZE;      if (rowCount > 0) {        rowLocation = dataPage.getShort(_format.OFFSET_DATA_ROW_LOCATION_BLOCK +            (rowCount - 1) * _format.SIZE_ROW_LOCATION);        if (rowLocation < 0) {          // Deleted row          rowLocation &= ~0xc000;        }      }      rowLocation -= rowSize;      dataPage.putShort(_format.OFFSET_DATA_ROW_LOCATION_BLOCK +          rowCount * _format.SIZE_ROW_LOCATION, rowLocation);      dataPage.position(rowLocation);      dataPage.put(rowData[i]);      iter = _indexes.iterator();      while (iter.hasNext()) {        Index index = (Index) iter.next();        index.addRow((Object[]) rows.get(i), pageNumber, (byte) rowCount);      }    }    _pageChannel.writePage(dataPage, pageNumber);        //Update tdef page    ByteBuffer tdefPage = _pageChannel.createPageBuffer();    _pageChannel.readPage(tdefPage, _tableDefPageNumber);    tdefPage.putInt(_format.OFFSET_NUM_ROWS, ++_rowCount);    iter = _indexes.iterator();    for (int i = 0; i < _indexes.size(); i++) {      tdefPage.putInt(_format.OFFSET_INDEX_DEF_BLOCK +          i * _format.SIZE_INDEX_DEFINITION + 4, _rowCount);      Index index = (Index) iter.next();      index.update();    }    _pageChannel.writePage(tdefPage, _tableDefPageNumber);  }