Java Array Slice arraySlice(int[] source, int start, int count)

Here you can find the source of arraySlice(int[] source, int start, int count)

Description

Returns a range of elements of source from start to end of the array.

License

Open Source License

Declaration

public static int[] arraySlice(int[] source, int start, int count) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from w w  w  .ja va 2 s  .c o m*/
     * Returns a range of elements of source from start to end of the array.
     */
    public static int[] arraySlice(int[] source, int start, int count) {

        int[] slice = new int[count];

        System.arraycopy(source, start, slice, 0, count);

        return slice;
    }
}

Related

  1. arraySlice(Object[] source, Object[] dest, int startIdx)
  2. slice(byte[] buffer, int start, int end)
  3. slice(byte[] source, int start, int end)
  4. slice(Object[] objects, int begin, int length)