Adds a record for an unchanged segment of text.
Normally called from inside ICU string transformation functions, not user code.
@hide draft / provisional / internal are hidden on Android
765860
public void addUnchanged(int unchangedLength) {
        if(unchangedLength < 0) {
            throw new IllegalArgumentException(
                    "addUnchanged(" + unchangedLength + "): length must not be negative");
        }
        // Merge into previous unchanged-text record, if any.
        int last = lastUnit();
        if(last < MAX_UNCHANGED) {
            int remaining = MAX_UNCHANGED - last;
            if (remaining >= unchangedLength) {
                setLastUnit(last + unchangedLength);
                return;
            }
            setLastUnit(MAX_UNCHANGED);
            unchangedLength -= remaining;
        }
        // Split large lengths into multiple units.
        while(unchangedLength >= MAX_UNCHANGED_LENGTH) {
            append(MAX_UNCHANGED);
            unchangedLength -= MAX_UNCHANGED_LENGTH;
        }
        // Write a small (remaining) length.
        if(unchangedLength > 0) {
            append(unchangedLength - 1);
        }
    }
1320627
public void add(Rec record) throws DBException
    {
        if (this.getRecord().getEditMode() != Constants.EDIT_ADD)
            throw new DBException(Constants.INVALID_RECORD);
        m_record = (FieldList)record;
        this.fieldsToData(record);
        this.doAdd(record);
        this.setDataSource(null);
        this.getRecord().setEditMode(Constants.EDIT_NONE);
    }
28615
def add_record(self, record):
        
        record.setdefault('_oai', {}).setdefault('sets', [])

        assert not self.has_record(record)

        record['_oai']['sets'].append(self.spec)
658899
private void createExtendedElement(StringBuilder sb, RepositoryLogRecord record){
		sb.append(lineSeparator).append(INDENT[0]).append("<extendedDataElements name=\"CommonBaseEventLogRecord:level\" type=\"noValue\">");
		sb.append(lineSeparator).append(INDENT[1]).append("<children name=\"CommonBaseEventLogRecord:name\" type=\"string\">");
		sb.append(lineSeparator).append(INDENT[2]).append("<values>").append(record.getLevel().getName()).append("</values>");
		sb.append(lineSeparator).append(INDENT[1]).append("</children>");
		sb.append(lineSeparator).append(INDENT[1]).append("<children name=\"CommonBaseEventLogRecord:value\" type=\"int\">");
		sb.append(lineSeparator).append(INDENT[2]).append("<values>").append(record.getLevel().intValue()).append("</values>");
		sb.append(lineSeparator).append(INDENT[1]).append("</children>");
		sb.append(lineSeparator).append(INDENT[0]).append("</extendedDataElements>");    	
	}
1144819
def insert_text(self, string):
        """
        self.l_buffer.insert_text(string, self.argument_reset)
        self.finalize()
548164
private static void appendEncoded(StringBuilder sb, String value) {
        for (char ch : value.toCharArray()) {
            if (isUnreserved(ch)) sb.append(ch);
            else appendEscapedByte(sb, (byte) ch);
        }
    }
1286875
public void addRecord(String key,
                          long l) throws TarMalformatException, IOException {
        addRecord(key, Long.toString(l));
    }
43275
public void put(String strKey, Object strValue)
    {
        if (this.getMessageFieldDesc(strKey) != null)
            this.getMessageFieldDesc(strKey).put(strValue);
        else
            this.putNative(strKey, strValue);
    }
1274249
def assignCurrentRecord(self, text):
        
        if self.showTreePopup():
            item = self._treePopupWidget.currentItem()
            if item:
                self._currentRecord = item.record()
            else:
                self._currentRecord = None
            return
        
        # look up the record for the given text
        if text:
            index = self.findText(text)
        elif self.isRequired():
            index = 0
        else:
            index = -1
        
        # determine new record to look for
        record = self.recordAt(index)
        if record == self._currentRecord:
            return
        
        # set the current index and record for any changes
        self._currentRecord = record
        self.setCurrentIndex(index)
601364
def append_text(self, text):
        

        if (self.conversions and
                isinstance(self.conversions[-1],
                           conversions.StringConversion)):
            self.conversions[-1].append(text)
        else:
            self.conversions.append(conversions.StringConversion(text))
964481
public void markRecord(BufferedRecord<D> record, int bytesWritten) {
    synchronized (this) {
      thunks.add(new Thunk<>(record, bytesWritten));
      byteSize += bytesWritten;
    }
  }
315955
function _addPlaceholders(content, section) {
  const prefix = section.name !== Section.DEFAULT_NAME ? `${section.name}::` : '';

  if (content.length === 0) {
    const placeholders = Utils.reduce(section.fields, (memo, params, token) => {
      if (!Utils.has(Record.SPECIAL_FIELDS, params.name)) {
        /* eslint-disable-next-line no-param-reassign */
        memo[token] = `{{${prefix}${params.name}}}`;
      }
      return memo;
    }, {});
    content.push(placeholders);
  } else if (section.keyword !== 'form') {
    Utils.each(content, (record) => {
      Utils.each(record, (value, key) => {
        const { name } = section.fields[key];

        if (Utils.isEmpty(value) && name) {
          /* eslint-disable-next-line no-param-reassign */
          record[key] = `{{${prefix}${name}}}`;
        }
      });
    });
  }

  return content;
}
1258405
public void addString(String str) {
        if (mSize == mStrings.length) {
            String[] old = mStrings;
            int oldSize = old.length;
            mStrings = new String[oldSize + (oldSize << 1)];
            System.arraycopy(old, 0, mStrings, 0, oldSize);
        }
        mStrings[mSize++] = str;
    }
696236
@Override
    public synchronized void addRecord(Slice record, boolean force)
            throws IOException
    {
        checkState(!closed.get(), "Log has been closed");

        SliceInput sliceInput = record.input();

        // used to track first, middle and last blocks
        boolean begin = true;

        // Fragment the record int chunks as necessary and write it.  Note that if record
        // is empty, we still want to iterate once to write a single
        // zero-length chunk.
        do {
            int bytesRemainingInBlock = BLOCK_SIZE - blockOffset;
            checkState(bytesRemainingInBlock >= 0);

            // Switch to a new block if necessary
            if (bytesRemainingInBlock < HEADER_SIZE) {
                if (bytesRemainingInBlock > 0) {
                    // Fill the rest of the block with zeros
                    // todo lame... need a better way to write zeros
                    fileChannel.write(ByteBuffer.allocate(bytesRemainingInBlock));
                }
                blockOffset = 0;
                bytesRemainingInBlock = BLOCK_SIZE - blockOffset;
            }

            // Invariant: we never leave less than HEADER_SIZE bytes available in a block
            int bytesAvailableInBlock = bytesRemainingInBlock - HEADER_SIZE;
            checkState(bytesAvailableInBlock >= 0);

            // if there are more bytes in the record then there are available in the block,
            // fragment the record; otherwise write to the end of the record
            boolean end;
            int fragmentLength;
            if (sliceInput.available() > bytesAvailableInBlock) {
                end = false;
                fragmentLength = bytesAvailableInBlock;
            }
            else {
                end = true;
                fragmentLength = sliceInput.available();
            }

            // determine block type
            LogChunkType type;
            if (begin && end) {
                type = LogChunkType.FULL;
            }
            else if (begin) {
                type = LogChunkType.FIRST;
            }
            else if (end) {
                type = LogChunkType.LAST;
            }
            else {
                type = LogChunkType.MIDDLE;
            }

            // write the chunk
            writeChunk(type, sliceInput.readSlice(fragmentLength));

            // we are no longer on the first chunk
            begin = false;
        } while (sliceInput.isReadable());

        if (force) {
            fileChannel.force(false);
        }
    }
1216426
def add(self, text):
        
        if self._is_stringable(text) or self._is_qstring(text):
            self.text.append(PlainText(text))
        elif isinstance(text, Text):
            self.text.append(text)
        elif text is None or (hasattr(text, 'isNull') and text.isNull()):
            self.text.append(PlainText(
                tr('None or Null found from the data.')))
        else:
            raise InvalidMessageItemError(text, text.__class__)
410012
private void setDataSegmentInternal(final String iName) {
    final int dataId = storage.getDataSegmentIdByName(iName);
    config.setDataSegmentId(dataId);
    storage.getConfiguration().update();
  }
1034924
private static void append(Appendable app, CharSequence s) {
        try {
            app.append(s);
        } catch (IOException e) {
            throw new ICUUncheckedIOException(e);
        }
    }