public long addMore(long refWord, byte[] valueBytes, int valueStart, int valueLength,
      WriteBuffers.Position unsafeReadPos) {

    // Preconditions.checkState(!KeyRef.getIsInvalidFlag(refWord));

    /*
     * Extract information from the reference word.
     */
    final long referenceAbsoluteOffset =
        KeyRef.getAbsoluteOffset(refWord) - KeyRef.AbsoluteOffset.byteLength;

    // Where the new value record will be written.
    long nextAbsoluteValueOffset = writeBuffers.getWritePoint();

    if (KeyRef.getIsSingleFlag(refWord)) {

      // Mark reference as having more than 1 value.
      refWord &= KeyRef.IsSingleFlag.flagOffMask;

      // Write zeros to indicate no 3rd record.
      writeBuffers.write(RelativeOffset.zeroPadding);
    } else {

      // To insert next value record above count 2:

      // 1) Read next relative offset in first record (this is a positive relative offset) to
      //    last inserted value record.
      long oldPrevRelativeValueOffset =
          writeBuffers.readNByteLong(
              referenceAbsoluteOffset, RelativeOffset.byteLength, unsafeReadPos);

      // 2) Relative offset is positive from first record to last inserted value record.
      long prevAbsoluteValueOffset = referenceAbsoluteOffset + oldPrevRelativeValueOffset;

      // 3) Since previous record is before the new one, subtract because we store relative offsets
      //    as unsigned.
      long newPrevRelativeValueOffset = nextAbsoluteValueOffset - prevAbsoluteValueOffset;
      // Preconditions.checkState(newPrevRelativeValueOffset >= 0);
      writeBuffers.writeFiveByteULong(newPrevRelativeValueOffset);
    }

    writeBuffers.writeVInt(valueLength);
    writeBuffers.write(valueBytes, valueStart, valueLength);

    // Overwrite relative offset in first record.
    long newRelativeOffset = nextAbsoluteValueOffset - referenceAbsoluteOffset;
    // Preconditions.checkState(newRelativeOffset >= 0);
    writeBuffers.writeFiveByteULong(referenceAbsoluteOffset, newRelativeOffset);

    return refWord;
  }
@param refWord
@param valueBytes
@param valueStart
@param valueLength
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/mapjoin/fast/VectorMapJoinFastBytesHashMapStore.java