Java Array Copy Arrays_copyOf(int[] pos, int length)

Here you can find the source of Arrays_copyOf(int[] pos, int length)

Description

GWT doesn't supply a Arrays.copyOf...

License

Apache License

Parameter

Parameter Description
pos a parameter
length a parameter

Declaration

private static int[] Arrays_copyOf(int[] pos, int length) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**//from   w w w  . j  av a 2 s .  com
     * GWT doesn't supply a Arrays.copyOf... therefore we implement it ourselves.
     * 
     * @param pos
     * @param length
     * @return
     */
    private static int[] Arrays_copyOf(int[] pos, int length) {
        int[] result = new int[pos.length];
        for (int i = 0; i < pos.length; i++)
            result[i] = pos[i];
        return result;
    }
}

Related

  1. arrayCopy(T[] x)
  2. arrayCopyAndAddEntry(T[] base, T extra)
  3. arraycopyAndInsertInt(final int[] src, final int idx, final int value)
  4. arrayCopyToNull(T[] source, int sourceOffset, T[] destination, int destinationOffset)
  5. arrayCopyWithRemoval(Object[] src, Object[] dst, int idxToRemove)
  6. copy(byte[] bytes)
  7. copy(byte[] data, int from)
  8. copy(double[][] a)
  9. copy(final boolean[] array)