private long getFirstRecordLengthsOffset(long ref, WriteBuffers.Position readPos) {
    long tailOffset = Ref.getOffset(ref);
    if (Ref.hasList(ref)) {
      long relativeOffset = (readPos == null) ? writeBuffers.unsafeReadNByteLong(tailOffset, 5)
          : writeBuffers.readNByteLong(tailOffset, 5, readPos);
      tailOffset += relativeOffset;
    }
    return tailOffset;
  }
@param ref Reference.
@return The offset to value and key length vlongs of the first record referenced by ref.
ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/BytesBytesMultiHashMap.java