core/src/main/java/com/orientechnologies/orient/core/storage/index/sbtree/multivalue/v1/Bucket.java
List<ORID> getValues(final int entryIndex) {
    assert isLeaf;

    int entryPosition = getIntValue(entryIndex * OIntegerSerializer.INT_SIZE + POSITIONS_ARRAY_OFFSET);
    int nextItem = getIntValue(entryPosition);
    entryPosition += OIntegerSerializer.INT_SIZE;

    // skip key
    if (encryption == null) {
      entryPosition += getObjectSizeInDirectMemory(keySerializer, entryPosition);
    } else {
      final int encryptedSize = getIntValue(entryPosition);
      entryPosition += OIntegerSerializer.INT_SIZE + encryptedSize;
    }

    int clusterId = getShortValue(entryPosition);
    long clusterPosition = getLongValue(entryPosition + OShortSerializer.SHORT_SIZE);

    final List<ORID> results = new ArrayList<>(8);
    results.add(new ORecordId(clusterId, clusterPosition));

    while (nextItem > 0) {
      final int nextNextItem = getIntValue(nextItem);
      final int nextItemSize = 0xFF & getByteValue(nextItem + OIntegerSerializer.INT_SIZE);

      for (int i = 0; i < nextItemSize; i++) {
        clusterId = getShortValue(nextItem + OIntegerSerializer.INT_SIZE + OByteSerializer.BYTE_SIZE + i * RID_SIZE);
        clusterPosition = getLongValue(
            nextItem + OIntegerSerializer.INT_SIZE + OShortSerializer.SHORT_SIZE + OByteSerializer.BYTE_SIZE + i * RID_SIZE);

        results.add(new ORecordId(clusterId, clusterPosition));
      }

      nextItem = nextNextItem;
    }

    return results;
  }
List<ORID> getValues(final int entryIndex) {
    assert isLeaf;

    int entryPosition = getIntValue(entryIndex * OIntegerSerializer.INT_SIZE + POSITIONS_ARRAY_OFFSET);
    int nextItem = getIntValue(entryPosition);
    entryPosition += OIntegerSerializer.INT_SIZE;

    // skip key
    if (encryption == null) {
      entryPosition += getObjectSizeInDirectMemory(keySerializer, entryPosition);
    } else {
      final int encryptedSize = getIntValue(entryPosition);
      entryPosition += OIntegerSerializer.INT_SIZE + encryptedSize;
    }

    int clusterId = getShortValue(entryPosition);
    long clusterPosition = getLongValue(entryPosition + OShortSerializer.SHORT_SIZE);

    final List<ORID> results = new ArrayList<>(8);
    results.add(new ORecordId(clusterId, clusterPosition));

    while (nextItem > 0) {
      final int nextNextItem = getIntValue(nextItem);
      final int nextItemSize = 0xFF & getByteValue(nextItem + OIntegerSerializer.INT_SIZE);

      for (int i = 0; i < nextItemSize; i++) {
        clusterId = getShortValue(nextItem + OIntegerSerializer.INT_SIZE + OByteSerializer.BYTE_SIZE + i * RID_SIZE);
        clusterPosition = getLongValue(
            nextItem + OIntegerSerializer.INT_SIZE + OShortSerializer.SHORT_SIZE + OByteSerializer.BYTE_SIZE + i * RID_SIZE);

        results.add(new ORecordId(clusterId, clusterPosition));
      }

      nextItem = nextNextItem;
    }

    return results;
  }
Obtains the value stored under the given entry index in this bucket.

@param entryIndex the value entry index.

@return the obtained value.