class StaxPoiSheet implements IKSheet {

  @Override
  public IKCell[] getRow( int rownr ) {
    // xlsx raw row numbers are 1-based index, IKSheet is 0-based

    if ( rownr < 0 || rownr >= numRows ) {
      // IKSheet requires out of bounds here
      throw new ArrayIndexOutOfBoundsException( rownr );
    }
    if ( rownr + 1 < firstRow ) {
      // before first non-empty row
      return new IKCell[ 0 ];
    }
    if ( rownr > 0 && currentRow == rownr + 1 ) {
      if ( currentRowCells != null ) {
        return currentRowCells;
      }
      // The case when the table contains the empty row(s) before the header
      // but at the same time user wants to read starting from 0 row
      return new IKCell[ 0 ];
    }
    try {
      if ( currentRow >= rownr + 1 ) {
        // allow random access per api despite performance hit
        resetSheetReader();
      }
      while ( sheetReader.hasNext() ) {
        int event = sheetReader.next();
        if ( event == XMLStreamConstants.START_ELEMENT && sheetReader.getLocalName().equals( "row" ) ) {
          String rowIndicator = sheetReader.getAttributeValue( null, "r" );
          currentRow = Integer.parseInt( rowIndicator );
          if ( currentRow < rownr + 1 ) {
            continue;
          }
          currentRowCells = parseRow();
          return currentRowCells;
        }
      }
    } catch ( Exception e ) {
      throw new RuntimeException( e );
    }
    numRows = currentRow;
    return new IKCell[] {};
  }

  public  StaxPoiSheet( XSSFReader reader, String sheetName, String sheetID );

}