code: private void fetchResultBatch(RecordSetList<JsonElement> rs, int initialRecordCount)
        throws DataRecordException, IOException {
      int recordCount = initialRecordCount;
  
      // Stream the resultset through CSV reader to identify columns in each record
      InputStreamCSVReader reader = new InputStreamCSVReader(this.bulkBufferedReader);
  
      // Get header if it is first run of a new resultset
      if (this.isNewBulkResultSet()) {
        this.bulkRecordHeader = reader.nextRecord();
        this.bulkResultColumCount = this.bulkRecordHeader.size();
        this.setNewBulkResultSet(false);
      }
  
      // Get record from CSV reader stream
      while ((this.csvRecord = reader.nextRecord()) != null) {
        // Convert CSV record to JsonObject
        JsonObject jsonObject = Utils.csvToJsonObject(this.bulkRecordHeader, this.csvRecord, this.bulkResultColumCount);
        rs.add(jsonObject);
        recordCount++;
        this.bulkRecordCount++;
  
        // Insert records in record set until it reaches the batch size
        if (recordCount >= batchSize) {
          log.info("Total number of records processed so far: " + this.bulkRecordCount);
          break;
        }
      }
    }
docs: Fetch records into a {@link RecordSetList} up to the configured batch size {@link #batchSize}. This batch is not
  the entire Salesforce result batch. It is an internal batch in the extractor for buffering a subset of the result
  stream that comes from a Salesforce batch for more efficient processing.
  @param rs the record set to fetch into
  @param initialRecordCount Initial record count to use. This should correspond to the number of records already in rs.
  This is used to limit the number of records returned in rs to {@link #batchSize}.
  @throws DataRecordException
  @throws IOException