Java Array Sub Array subArray(byte[] src, int start)

Here you can find the source of subArray(byte[] src, int start)

Description

sub Array

License

Apache License

Declaration

public static byte[] subArray(byte[] src, int start) 

Method Source Code

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

public class Main {

    public static byte[] subArray(byte[] src, int start) {
        if (start == 0) {
            return src;
        }/* w ww .  j  av  a2s.  c o m*/
        int length = src.length - start;
        byte[] dest = new byte[length];
        System.arraycopy(src, start, dest, 0, length);
        return dest;
    }

    public static byte[] subArray(byte[] src, int start, int length) {
        if (start == 0 && src.length == length) {
            return src;
        }
        byte[] dest = new byte[length];
        System.arraycopy(src, start, dest, 0, length);
        return dest;
    }
}

Related

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