code: public long readMany(long beginSequence, ReadResultSetImpl result) {
          checkReadSequence(beginSequence);
  
          long seq = beginSequence;
          while (seq <= ringbuffer.tailSequence()) {
              result.addItem(seq, readOrLoadItem(seq));
              seq++;
              if (result.isMaxSizeReached()) {
                  // we have found all items we are looking for. We are done.
                  break;
              }
          }
          return seq;
      }
docs: Reads multiple items from the ring buffer and adds them to {@code result}
  in the stored format. If an item is not available, it will try and
  load it from the ringbuffer store.
  
  @param beginSequence the sequence of the first item to read.
  @param result        the List where the result are stored in.
  @return returns the sequenceId of the next item to read. This is needed if not all required items are found.
  @throws StaleSequenceException if the sequence is :
  1. larger than the tailSequence or
  2. smaller than the headSequence and the data store is disabled