Java Array Sub Array subarray(byte[] text, int from, int to)

Here you can find the source of subarray(byte[] text, int from, int to)

Description

subarray

License

Open Source License

Declaration

public static byte[] subarray(byte[] text, int from, int to) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static byte[] subarray(byte[] text, int from, int to) {
        int len = to - from;
        byte[] returnText = new byte[len];
        for (int i = 0; i < len && i + from < text.length; i++) {
            returnText[i] = text[i + from];
        }//from  w  w w.  j av  a 2  s .com
        return returnText;
    }
}

Related

  1. subarray(byte[] src, int beginIndex)
  2. subArray(byte[] src, int offset, int len)
  3. subArray(byte[] src, int pos, int length)
  4. subArray(byte[] src, int start)
  5. subArray(byte[] src, int start, int limit)
  6. subarray(char[][] array, int start, int end)
  7. subArray(double[] a, int begin, int end)
  8. subArray(double[] arr, int start, int fim)
  9. subArray(double[] array, int startIndex, int length)