code: public void addItem(String term, Integer offsetStart, Integer offsetEnd,
        Integer posIncr, BytesRef payload, Integer flags) {
      if (!closed) {
        tokenNumber++;
        MtasUpdateRequestProcessorResultItem item = new MtasUpdateRequestProcessorResultItem(
            term, offsetStart, offsetEnd, posIncr, payload, flags);
        try {
          objectOutputStream.writeObject(item);
          objectOutputStream.reset();
          objectOutputStream.flush();
        } catch (IOException e) {
          forceCloseAndDelete();
          log.debug(e);
        }
      }
    }
docs: Adds the item.
  
  @param term the term
  @param offsetStart the offset start
  @param offsetEnd the offset end
  @param posIncr the pos incr
  @param payload the payload
  @param flags the flags