code: int fillWindow(CursorWindow window, int startPos, int requiredPos, boolean countAllRows) {
          acquireReference();
          try {
              window.acquireReference();
              try {
                  int numRows = getSession().executeForCursorWindow(getSql(), getBindArgs(),
                          window, startPos, requiredPos, countAllRows, getConnectionFlags(),
                          mCancellationSignal);
                  return numRows;
              } catch (SQLiteDatabaseCorruptException ex) {
                  onCorruption();
                  throw ex;
              } catch (SQLiteException ex) {
                  Log.e(TAG, "exception: " + ex.getMessage() + "; query: " + getSql());
                  throw ex;
              } finally {
                  window.releaseReference();
              }
          } finally {
              releaseReference();
          }
      }
docs: Reads rows into a buffer.
  
  @param window The window to fill into
  @param startPos The start position for filling the window.
  @param requiredPos The position of a row that MUST be in the window.
  If it won't fit, then the query should discard part of what it filled.
  @param countAllRows True to count all rows that the query would
  return regardless of whether they fit in the window.
  @return Number of rows that were enumerated.  Might not be all rows
  unless countAllRows is true.
  
  @throws SQLiteException if an error occurs.
  @throws OperationCanceledException if the operation was canceled.