src/org/kocakosm/pitaya/util/XArrays.java
public static long[] copyOf(long[] a, int off, int len)
	{
		long[] copy = new long[len];
		if (len > a.length - off) {
			System.arraycopy(a, off, copy, 0, a.length - off);
		} else {
			System.arraycopy(a, off, copy, 0, len);
		}
		return copy;
	}
public static long[] copyOf(long[] a, int off, int len)
	{
		long[] copy = new long[len];
		if (len > a.length - off) {
			System.arraycopy(a, off, copy, 0, a.length - off);
		} else {
			System.arraycopy(a, off, copy, 0, len);
		}
		return copy;
	}
public static long [ ] copyOf ( long [ ] a , int off , int len ) { long [ ] copy = new long [ len ] ; if ( len > a . length - off ) { System . arraycopy ( a , off , copy , 0 , a . length - off ) ; } else { System . arraycopy ( a , off , copy , 0 , len ) ; } return copy ; }
Copies the specified range of elements from the given array into a
new array. The returned array will be padded with {@code 0}, if
necessary, so that it has an exact length of {@code len}.

@param a the source array.
@param off the starting position in the source array.
@param len the number of elements to copy (returned array's length).

@return a new array containing the specified range of the source array.

@throws NullPointerException if {@code a} is {@code null}.
@throws ArrayIndexOutOfBoundsException if {@code off} is negative.
@throws NegativeArraySizeException if {@code len} is negative.
Copies the specified range of elements from the given array into a new array . The returned array will be padded with { @code 0 } if necessary so that it has an exact length of { @code len } .