mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Yannick Lecaillez
29.50.2016 e3a3030cd14ba12631b8c50d955ec800b247fb72
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryIDSet.java
@@ -12,7 +12,7 @@
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2006-2008 Sun Microsystems, Inc.
 * Portions Copyright 2014-2015 ForgeRock AS.
 * Portions Copyright 2014-2016 ForgeRock AS.
 */
package org.opends.server.backends.pluggable;
@@ -696,6 +696,30 @@
  }
  /**
   * Copy the list of IDs contained in this {@link EntryIDSet} into the given
   * array. This function does nothing if this {@link EntryIDSet} is not
   * defined.
   *
   * @param array
   *          Array where to copy this {@link EntryIDSet} entries id.
   * @param offset
   *          The offset within the array of the first byte to be written; must
   *          be non-negative and no larger than array.length.
   * @return The number of elements copied or -1 if this {@link EntryIDSet} is
   *         not defined.
   */
  public int copyTo(long[] array, int offset)
  {
    if (isDefined())
    {
      final long[] ids = concreteImpl.getIDs();
      System.arraycopy(ids, 0, array, offset, ids.length);
      return ids.length;
    }
    return -1;
  }
  /**
   * Returns this {@link EntryIDSet} as a long array holding all the entryIDs.
   *
   * @return a new long array containing all the entryIDs included in this {@link EntryIDSet}.