Method to perform PutRecordBatch operation with the given record list.

@param recordList the collection of records
@return the output of PutRecordBatch
332190
private static PutRecordBatchResult putRecordBatch(List<Record> recordList) {
        PutRecordBatchRequest putRecordBatchRequest = new PutRecordBatchRequest();
        putRecordBatchRequest.setDeliveryStreamName(deliveryStreamName);
        putRecordBatchRequest.setRecords(recordList);

        // Put Record Batch records. Max No.Of Records we can put in a
        // single put record batch request is 500
        return firehoseClient.putRecordBatch(putRecordBatchRequest);
    }
54492
public StringRecordBuilder<D> addAll(Collection<String> records) {
    for (String value : checkNotNull(records, "records")) {
      add(value);
    }
    return this;
  }
75498
public FieldList moveThruMultipleTables(int iRelPosition) throws DBException
    { // ****ONLY TESTED FOR iRelPosition = +1****
        boolean bIsOpen = m_bIsOpen;
        if (!m_bIsOpen)
            this.open();
        BaseTable table = null;
        BaseTable tableNext = null;
        if (((m_iRecordStatus & DBConstants.RECORD_NEXT_PENDING) == DBConstants.RECORD_NEXT_PENDING)
            && (iRelPosition == DBConstants.NEXT_RECORD))
        {
            m_iRecordStatus = DBConstants.RECORD_NORMAL;
            tableNext = this.getCurrentTable();   // Special case - last call was hasNext()
        }
        else if (((m_iRecordStatus & DBConstants.RECORD_PREVIOUS_PENDING) == DBConstants.RECORD_PREVIOUS_PENDING)
            && (iRelPosition == DBConstants.PREVIOUS_RECORD))
        {
            m_iRecordStatus = DBConstants.RECORD_NORMAL;
            tableNext = this.getCurrentTable();   // Special case - last call was hasNext()
        }
        else
        { // First, make sure all the tables are opened and positioned on valid records.
            if ((!bIsOpen) || (iRelPosition == DBConstants.FIRST_RECORD))   // Need to use a different variable
            {   // If this is the first time thru, open and move to the first record
                Iterator<BaseTable> iterator = this.getTables();
                while (iterator.hasNext())
                {
                    table = iterator.next();
                    table.close();
                    table.getRecord().setKeyArea(this.getRecord().getDefaultOrder());
                    if (table.hasNext())
                    {
                        if (table != this.getCurrentTable())
                            table.move(+1);   // Move to first record
                        else
                            iRelPosition = +1;
                    }
                }
                m_bIsOpen = true; // Yes this file is now open.
            }
            if (!this.getCurrentTable().isEOF())
                this.getCurrentTable().move(iRelPosition);  // First, move the current table in the correct direction.
        // Now, compare the records to find the lowest key
            Iterator<BaseTable> iterator = this.getTables();
            while (iterator.hasNext())
            {
                table = iterator.next();
                if (!table.isEOF())
                {
                    if (tableNext == null)
                        tableNext = table;      // None here yet, this is the lowest
                    else
                    { // Now compare and get the lowest
                        int iCompareValue = 0;
                        int iKeyFields = table.getRecord().getKeyArea().getKeyFields() + DBConstants.MAIN_KEY_FIELD;
                        for (int iKeyFieldSeq = DBConstants.MAIN_KEY_FIELD; iKeyFieldSeq < iKeyFields; iKeyFieldSeq++)
                        {
                            BaseField fldCompare = table.getRecord().getKeyArea().getKeyField(iKeyFieldSeq).getField(DBConstants.FILE_KEY_AREA);
                            BaseField fldNext = tableNext.getRecord().getKeyArea().getKeyField(iKeyFieldSeq).getField(DBConstants.FILE_KEY_AREA);
                            iCompareValue = fldCompare.compareTo(fldNext);
                            if (this.getRecord().getKeyArea() != null)
                                if (this.getRecord().getKeyArea().getKeyField(iKeyFieldSeq) != null)
                                    if (this.getRecord().getKeyArea().getKeyOrder(iKeyFieldSeq) == DBConstants.DESCENDING)
                                iCompareValue = -iCompareValue;
                            if (iCompareValue != 0)
                                break;
                        }
                        if (iCompareValue < 0)
                            tableNext = table;      // This is the lowest so far.
                    }
                }
            }
        }
        if (tableNext == null)
        {
            Iterator<BaseTable> iterator = this.getTables();
            while (iterator.hasNext())
            {   // If this table is suppose to be PAST EOF, make sure all the records are too.
                table = iterator.next();
                if (iRelPosition == DBConstants.NEXT_RECORD)
                    if (table.isEOF())
                        table.move(+1);
            }
            return null;
        }
        this.setCurrentTable(tableNext);    // Never allow currentTable to be null.
        Record record = tableNext.getRecord();
        for (int iFieldSeq = DBConstants.MAIN_FIELD; iFieldSeq < record.getFieldCount(); ++iFieldSeq)
        {
//?         if (bDisplayOption)
            record.getField(iFieldSeq).displayField();      // Display this field
        }
        return record;
    }
222766
def _update_record(self, identifier, rtype=None, name=None, content=None):
        """"""
        if identifier is not None:
            if name is not None:
                records = self._list_records_internal(identifier=identifier)
                if len(records) == 1 and records[0]['name'] != self._full_name(name):
                    # API does not allow us to update name directly
                    self._update_record_with_name(
                        records[0], rtype, name, content)
                else:
                    self._update_record_with_id(identifier, rtype, content)
            else:
                self._update_record_with_id(identifier, rtype, content)
        else:
            guessed_record = self._guess_record(rtype, name)
            self._update_record_with_id(guessed_record['id'], rtype, content)
        return True
886494
public void setDatabaseList(java.util.Collection<Database> databaseList) {
        if (databaseList == null) {
            this.databaseList = null;
            return;
        }

        this.databaseList = new java.util.ArrayList<Database>(databaseList);
    }
571414
protected int update(Connection connection, RecordStream recordStream)
            throws SQLException, IOException {
        int count = 0;
        PreparedStatement insertFileHash = statement(connection,
                Query.INSERT_FILEHASH);
        PreparedStatement insertMeta = statement(connection, Query.INSERT_META);
        PreparedStatement insertCVE = statement(connection, Query.INSERT_CVES);
        while (recordStream.hasNext()) {
            VictimsRecord vr = recordStream.getNext();
            String hash = vr.hash.trim();

            // remove if already present
            deleteRecord(connection, hash);

            // add the new/updated hash
            int id = insertRecord(connection, hash);

            // insert file hahes
            for (String filehash : vr.getHashes(Algorithms.SHA512).keySet()) {
                setObjects(insertFileHash, id, filehash.trim());
                insertFileHash.addBatch();
            }

            // insert metadata key-value pairs
            HashMap<String, String> md = vr.getFlattenedMetaData();
            for (String key : md.keySet()) {
                setObjects(insertMeta, id, key, md.get(key));
                insertMeta.addBatch();
            }

            // insert cves
            for (String cve : vr.cves) {
                setObjects(insertCVE, id, cve.trim());
                insertCVE.addBatch();
            }

            count++;
        }
        executeBatchAndClose(insertFileHash, insertMeta, insertCVE);
        return count;
    }
36973
public void set(Rec fieldList) throws DBException
    {
        Record recBase = this.getBaseRecord();
        Record recCurrent = this.getCurrentRecord();
        if (fieldList != recBase)
        {
            if (fieldList != recCurrent)
                throw new DBException("Can't change record class then add");
        }
        else
        {
            if (recBase != recCurrent)
                if (recCurrent.isModified())
                    this.copyRecordInfo(recBase, recCurrent, false, true);
            fieldList = this.moveToCurrentRecord((Record)fieldList);
        }
        if (fieldList != recBase)
        {
            this.getBaseRecord().matchListeners(this.getCurrentRecord(), false, true, true, true, true);      // Clone the listeners that are not there already.
            fieldList.getTable().set(fieldList);
        }
        else
            super.set(fieldList);   // Never (hopefully)
        // Note, since target record is passed, add listeners are called on the correct record
    }
1288799
public List<List<List<String>>> getRecordsAsString() {
        if(records == null)
            Collections.emptyList();
        List<List<List<String>>> ret = new ArrayList<>(records.size());
        for(List<BatchCSVRecord> record : records) {
            List<List<String>> add = new ArrayList<>();
            for(BatchCSVRecord batchCSVRecord : record) {
                for (SingleCSVRecord singleCSVRecord : batchCSVRecord.getRecords()) {
                    add.add(singleCSVRecord.getValues());
                }
            }

            ret.add(add);
        }

        return ret;
    }
1233852
protected Map<String, Map<Integer, Set<String>>> createUpdateList() {
    Map<String, Map<Integer, Set<String>>> updateList = new HashMap<>();
    updateList.put(UPDATE_TYPE_OFFSET, new HashMap<>());
    updateList.put(UPDATE_TYPE_POSITION, new HashMap<>());
    updateList.put(UPDATE_TYPE_LOCAL_REF_POSITION_START, new HashMap<>());
    updateList.put(UPDATE_TYPE_LOCAL_REF_POSITION_END, new HashMap<>());
    updateList.put(UPDATE_TYPE_LOCAL_REF_OFFSET_START, new HashMap<>());
    updateList.put(UPDATE_TYPE_LOCAL_REF_OFFSET_END, new HashMap<>());
    updateList.put(UPDATE_TYPE_VARIABLE, new HashMap<>());
    return updateList;
  }
311406
public FieldList move(int iRelPosition) throws DBException
    {
        Record record = (Record)super.move(iRelPosition);
        Iterator<BaseTable> iterator = this.getTables();
        while (iterator.hasNext())
        {
            BaseTable table = iterator.next();
            if ((table != null) && (table != this.getNextTable()))
                this.syncTables(table, record);
        }
        return record;
    }
198694
public Integer addRecord(Record r) {
        Integer rId = _unsafe_add(r);
        updateMeta(r);
        return rId;
    }
894561
public void insertOrReplaceRecord(T record) throws IOException {
		if (this.closed) {
			return;
		}

		final int searchHashCode = MathUtils.jenkinsHash(this.buildSideComparator.hash(record));
		final int posHashCode = searchHashCode % this.numBuckets;
		
		// get the bucket for the given hash code
		final MemorySegment originalBucket = this.buckets[posHashCode >> this.bucketsPerSegmentBits];
		final int originalBucketOffset = (posHashCode & this.bucketsPerSegmentMask) << NUM_INTRA_BUCKET_BITS;
		
		MemorySegment bucket = originalBucket;
		int bucketInSegmentOffset = originalBucketOffset;
		
		// get the basic characteristics of the bucket
		final int partitionNumber = bucket.get(bucketInSegmentOffset + HEADER_PARTITION_OFFSET);
		final InMemoryPartition<T> partition = this.partitions.get(partitionNumber);
		final MemorySegment[] overflowSegments = partition.overflowSegments;
		
		this.buildSideComparator.setReference(record);
		
		int countInSegment = bucket.getInt(bucketInSegmentOffset + HEADER_COUNT_OFFSET);
		int numInSegment = 0;
		int posInSegment = bucketInSegmentOffset + BUCKET_HEADER_LENGTH;

		// loop over all segments that are involved in the bucket (original bucket plus overflow buckets)
		while (true) {
			
			while (numInSegment < countInSegment) {
				
				final int thisCode = bucket.getInt(posInSegment);
				posInSegment += HASH_CODE_LEN;
					
				// check if the hash code matches
				if (thisCode == searchHashCode) {
					// get the pointer to the pair
					final int pointerOffset = bucketInSegmentOffset + BUCKET_POINTER_START_OFFSET + (numInSegment * POINTER_LEN);
					final long pointer = bucket.getLong(pointerOffset);
					
					// deserialize the key to check whether it is really equal, or whether we had only a hash collision
					T valueAtPosition = partition.readRecordAt(pointer);
					if (this.buildSideComparator.equalToReference(valueAtPosition)) {
						long newPointer = insertRecordIntoPartition(record, partition, true);
						bucket.putLong(pointerOffset, newPointer);
						return;
					}
				}
				numInSegment++;
			}
			
			// this segment is done. check if there is another chained bucket
			long newForwardPointer = bucket.getLong(bucketInSegmentOffset + HEADER_FORWARD_OFFSET);
			if (newForwardPointer == BUCKET_FORWARD_POINTER_NOT_SET) {
				
				// nothing found. append and insert
				long pointer = insertRecordIntoPartition(record, partition, false);

				if (countInSegment < NUM_ENTRIES_PER_BUCKET) {
					// we are good in our current bucket, put the values
					bucket.putInt(bucketInSegmentOffset + BUCKET_HEADER_LENGTH + (countInSegment * HASH_CODE_LEN), searchHashCode); // hash code
					bucket.putLong(bucketInSegmentOffset + BUCKET_POINTER_START_OFFSET + (countInSegment * POINTER_LEN), pointer); // pointer
					bucket.putInt(bucketInSegmentOffset + HEADER_COUNT_OFFSET, countInSegment + 1); // update count
				}
				else {
					insertBucketEntryFromStart(originalBucket, originalBucketOffset, searchHashCode, pointer, partitionNumber);
				}
				return;
			}
			
			final int overflowSegNum = (int) (newForwardPointer >>> 32);
			bucket = overflowSegments[overflowSegNum];
			bucketInSegmentOffset = (int) newForwardPointer;
			countInSegment = bucket.getInt(bucketInSegmentOffset + HEADER_COUNT_OFFSET);
			posInSegment = bucketInSegmentOffset + BUCKET_HEADER_LENGTH;
			numInSegment = 0;
		}
	}
174922
public FieldList move(int iRelPosition) throws DBException
    {
        this.setCurrentRecord(this.getBaseRecord());
        boolean bAfterRequery = !this.getBaseRecord().isOpen();
        if (!this.isOpen())
            this.open();    // Make sure any listeners are called before disabling.
        Object[] rgobjEnabledFields = this.getBaseRecord().setEnableNonFilter(null, false, false, false, false, true);
        try {
            Record record = (Record)super.move(iRelPosition);
            if (record == null)
                return null;

            this.getBaseRecord().setEnableNonFilter(rgobjEnabledFields, true, false, bAfterRequery, false, true);
            rgobjEnabledFields = null;
            
      //      this.getBaseRecord().handleValidRecord(); // Display Fields (handleValidRecord this was done in setEnableNonFilter)
            record = this.moveToCurrentRecord(record);
            if (record != null) if (record != this.getBaseRecord())
                record.handleValidRecord(); // Display Fields

            return record;
        } catch (DBException ex)    {
            throw ex;
        } finally {
            if (rgobjEnabledFields != null)
                this.getBaseRecord().setEnableNonFilter(rgobjEnabledFields, false, false, bAfterRequery, true, true);   // EOF
        }
    }
245808
public Collection<Record> findCandidateMatches(Record record) {
    if (directory == null)
      init();

    // if we have a geoprop it means that's the only way to search
    if (geoprop != null) {
      String value = record.getValue(geoprop.getName());
      if (value != null) {
        Filter filter = geoprop.geoSearch(value);
        return maintracker.doQuery(new MatchAllDocsQuery(), filter);
      }
    }

    // ok, we didn't do a geosearch, so proceed as normal.
    // first we build the combined query for all lookup properties
    BooleanQuery query = new BooleanQuery();
    for (Property prop : config.getLookupProperties()) {
      Collection<String> values = record.getValues(prop.getName());
      if (values == null)
        continue;
      for (String value : values)
        parseTokens(query, prop.getName(), value,
                    prop.getLookupBehaviour() == Property.Lookup.REQUIRED,
                    prop.getHighProbability());
    }

    // do the query
    return maintracker.doQuery(query);
  }

  /**
   * Stores state to disk and closes all open resources.
   */
  public void close() {
    if (directory == null)
      return;

    try {
      iwriter.close();
      directory.close();
      if (reader != null)
        reader.close();
    } catch (IOException e) {
      throw new DukeException(e);
    }
  }

  public String toString() {
    return "LuceneDatabase, max-search-hits: " + max_search_hits +
      ", min-relevance: " + min_relevance + ", fuzzy: " + fuzzy_search +
      ", boost-mode: " + boost_mode + ", path: " + path + "\n  " + directory;
  }

  // ----- INTERNALS

  private void init() {
    try {
      openIndexes(overwrite);
      openSearchers();
      initSpatial();
    } catch (Exception e) {
      // initialization failed, so clean up to prevent leaving us in an
      // inconsistent state https://github.com/larsga/Duke/issues/226
      directory = null;
      throw new DukeException(e);
    }
  }

  private void openIndexes(boolean overwrite) throws IOException {
    if (directory == null) {
      try {
        if (path == null)
          directory = new RAMDirectory();
        else {
          //directory = new MMapDirectory(new File(config.getPath()));
          // as per http://wiki.apache.org/lucene-java/ImproveSearchingSpeed
          // we use NIOFSDirectory, provided we're not on Windows
          if (Utils.isWindowsOS())
            directory = FSDirectory.open(new File(path));
          else
            directory = NIOFSDirectory.open(new File(path));
        }

        IndexWriterConfig cfg =
          new IndexWriterConfig(Version.LUCENE_CURRENT, analyzer);
        cfg.setOpenMode(overwrite ? IndexWriterConfig.OpenMode.CREATE :
                                    IndexWriterConfig.OpenMode.APPEND);
        iwriter = new IndexWriter(directory, cfg);
        iwriter.commit(); // so that the searcher doesn't fail
      } catch (IndexNotFoundException e) {
        if (!overwrite) {
          // the index was not there, so make a new one
          directory = null; // ensure we really do try again
          openIndexes(true);
        } else
          throw new DukeException(e);
      }
    }
  }

  public void openSearchers() throws IOException {
    reader = DirectoryReader.open(directory);
    searcher = new IndexSearcher(reader);
  }

  /**
   * Parses the query. Using this instead of a QueryParser in order
   * to avoid thread-safety issues with Lucene's query parser.
   *
   * @param fieldName the name of the field
   * @param value the value of the field
   * @return the parsed query
   */
  private Query parseTokens(String fieldName, String value) {
    BooleanQuery searchQuery = new BooleanQuery();
    if (value != null) {
      Analyzer analyzer = new KeywordAnalyzer();

      try {
        TokenStream tokenStream =
          analyzer.tokenStream(fieldName, new StringReader(value));
        tokenStream.reset();
        CharTermAttribute attr =
          tokenStream.getAttribute(CharTermAttribute.class);

        while (tokenStream.incrementToken()) {
          String term = attr.toString();
          Query termQuery = new TermQuery(new Term(fieldName, term));
          searchQuery.add(termQuery, Occur.SHOULD);
        }
      } catch (IOException e) {
        throw new DukeException("Error parsing input string '" + value + "' " +
                                "in field " + fieldName);
      }
    }

    return searchQuery;
  }

  /**
   * Parses Lucene query.
   * @param required Iff true, return only records matching this value.
   */
  private void parseTokens(BooleanQuery parent, String fieldName,
                             String value, boolean required, double probability) {
    value = escapeLucene(value);
    if (value.length() == 0)
      return;

    try {
      TokenStream tokenStream =
        analyzer.tokenStream(fieldName, new StringReader(value));
      tokenStream.reset();
      CharTermAttribute attr =
        tokenStream.getAttribute(CharTermAttribute.class);

      Float boost = getBoostFactor(probability, BoostMode.QUERY);

      while (tokenStream.incrementToken()) {
        String term = attr.toString();
        Query termQuery;
        if (fuzzy_search && isFuzzy(fieldName))
          termQuery = new FuzzyQuery(new Term(fieldName, term));
        else
          termQuery = new TermQuery(new Term(fieldName, term));

        if (boost != null)
          termQuery.setBoost(boost);
        parent.add(termQuery, required ? Occur.MUST : Occur.SHOULD);
      }
    } catch (IOException e) {
      throw new DukeException("Error parsing input string '"+value+"' "+
                              "in field " + fieldName);
    }
  }

  private boolean isFuzzy(String fieldName) {
    Comparator c = config.getPropertyByName(fieldName).getComparator();
    return c != null && c.isTokenized();
  }

  private String escapeLucene(String query) {
    char[] tmp = new char[query.length() * 2];
    int count = 0;
    for (int ix = 0; ix < query.length(); ix++) {
      char ch = query.charAt(ix);
      if (ch == '*' || ch == '?' || ch == '!' || ch == '&' || ch == '(' ||
          ch == ')' || ch == '-' || ch == '+' || ch == ':' || ch == '"' ||
          ch == '[' || ch == ']' || ch == '~' || ch == '{' || ch == '}' ||
          ch == '^' || ch == '|')
        tmp[count++] = '\\'; // these characters must be escaped
      tmp[count++] = ch;
    }

    return new String(tmp, 0, count).trim();
  }

  public Collection<Record> lookup(Property property, String value) {
    Query query = parseTokens(property.getName(), value);
    return maintracker.doQuery(query);
  }

  /**
   * The tracker is used to estimate the size of the query result
   * we should ask Lucene for. This parameter is the single biggest
   * influence on search performance, but setting it too low causes
   * matches to be missed. We therefore try hard to estimate it as
   * correctly as possible.
   *
   * The tracker uses a ring buffer of recent result sizes to
   * estimate the result size.
   */
  class EstimateResultTracker {
    private int limit;
    /**
     * Ring buffer containing n last search result sizes, except for
     * searches which found nothing.
     */
    private int[] prevsizes;
    private int sizeix; // position in prevsizes

    public EstimateResultTracker() {
      this.limit = 100;
      this.prevsizes = new int[10];
    }

    public Collection<Record> doQuery(Query query) {
      return doQuery(query, null);
    }

    public Collection<Record> doQuery(Query query, Filter filter) {
      List<Record> matches;
      try {
        ScoreDoc[] hits;

        int thislimit = Math.min(limit, max_search_hits);
        while (true) {
          hits = searcher.search(query, filter, thislimit).scoreDocs;
          if (hits.length < thislimit || thislimit == max_search_hits)
            break;
          thislimit = thislimit * 5;
        }

        matches = new ArrayList(Math.min(hits.length, max_search_hits));
        for (int ix = 0; ix < hits.length &&
                         hits[ix].score >= min_relevance; ix++)

          matches.add(new DocumentRecord(hits[ix].doc,
                                         searcher.doc(hits[ix].doc)));

        if (hits.length > 0) {
          synchronized(this) {
            prevsizes[sizeix++] = matches.size();
            if (sizeix == prevsizes.length) {
              sizeix = 0;
              limit = Math.max((int) (average() * SEARCH_EXPANSION_FACTOR), limit);
            }
          }
        }
      } catch (IOException e) {
        throw new DukeException(e);
      }
      return matches;
    }

    private double average() {
      int sum = 0;
      int ix = 0;
      for (; ix < prevsizes.length && prevsizes[ix] != 0; ix++)
        sum += prevsizes[ix];
      return sum / (double) ix;
    }
  }

  /**
   * Checks to see if we need the spatial support, and if so creates
   * the necessary context objects.
   */
  private void initSpatial() {
    // FIXME: for now, we only use geosearch if that's the only way to
    // find suitable records, since we don't know how to combine
    // geosearch ranking with normal search ranking.
    if (config.getLookupProperties().size() != 1)
      return;

    Property prop = config.getLookupProperties().iterator().next();
    if (!(prop.getComparator() instanceof GeopositionComparator))
      return;

    geoprop = new GeoProperty(prop);
  }

  public enum BoostMode {
    /**
     * Boost fields at query time.
     */
    QUERY,
    /**
     * Boost fields at index time. This means records must be
     * reindexed to change the boosting.
     */
    INDEX,
    /**
     * Don't boost fields.
     */
    NONE;
  }

  private Float getBoostFactor(double probability, BoostMode phase) {
    Float boost = null;
    if (phase == boost_mode) {
      double p = Math.min(0.99, probability); // don't divide by zero
      boost = (float) Math.sqrt(1.0 / ((1.0 - p) * 2.0));
    }
    return boost;
  }
}
1112606
public final void copyAllFields(Record record, FieldList fieldList)
    {
        for (int i = 0; i < fieldList.getFieldCount(); i++)
        {
            FieldInfo fieldInfo = fieldList.getField(i);
            BaseField field = record.getField(i);
            this.moveFieldToThin(fieldInfo, field, record);
        }
    }
927511
@Override
	public void writeRecord(Record record) throws IOException {
		int numRecFields = record.getNumFields();
		int readPos;

		for (int i = 0; i < this.numFields; i++) {
			readPos = this.recordPositions[i];
			if (readPos < numRecFields) {
				Value v = record.getField(this.recordPositions[i], this.classes[i]);
				if (v != null) {
					if (i != 0) {
						this.wrt.write(this.fieldDelimiter);
					}
					this.wrt.write(v.toString());
				} else {
					if (this.lenient) {
						if (i != 0) {
							this.wrt.write(this.fieldDelimiter);
						}
					} else {
						throw new RuntimeException("Cannot serialize record with <null> value at position: " + readPos);
					}
				}

			} else {
				if (this.lenient) {
					if (i != 0) {
						this.wrt.write(this.fieldDelimiter);
					}
				} else {
					throw new RuntimeException("Cannot serialize record with out field at position: " + readPos);
				}
			}

		}

		// add the record delimiter
		this.wrt.write(this.recordDelimiter);
	}
233210
public void add(Rec fieldList) throws DBException
    {
        Record record = (Record)fieldList;
        if (((this.getRecord().getOpenMode() & DBConstants.OPEN_REFRESH_AND_LOCK_ON_CHANGE_STRATEGY) != DBConstants.OPEN_REFRESH_AND_LOCK_ON_CHANGE_STRATEGY)
            || (record.isRefreshedRecord()))
                this.restoreMainRecord(record, true);
        super.add(record);
    }