Example #1
0
  public static <T> void shallowCopy(
      final ReferenceArray<T> src,
      final long srcOffset,
      final ReferenceArray<T> dst,
      final long dstOffset,
      final long count) {

    if (srcOffset + count > Integer.MAX_VALUE || dstOffset + count > Integer.MAX_VALUE) {
      throw new ArrayIndexOutOfBoundsException();
    }

    int length = (int) count;
    int srcOff = (int) srcOffset;
    int dstOff = (int) dstOffset;

    System.arraycopy(src.asArray(), srcOff, dst.asArray(), dstOff, length);
  }
Example #2
0
 private static Branch create(int nodeSize) {
   int length = (nodeSize * 2) + 1;
   return ReferenceArray.newInstance(lookup, Branch.class, length);
 }