Java Array Copy arraycopy(byte[] src, int src_position, byte[] dst, int dst_position, int length)

Here you can find the source of arraycopy(byte[] src, int src_position, byte[] dst, int dst_position, int length)

Description

arraycopy

License

Open Source License

Declaration

public static void arraycopy(byte[] src, int src_position, byte[] dst, int dst_position, int length) 

Method Source Code

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

public class Main {
    public static void arraycopy(byte[] src, int src_position, byte[] dst, int dst_position, int length) {
        if (src_position < 0)
            throw new IllegalArgumentException("src_position was less than 0.  Actual value " + src_position);
        if (src_position >= src.length)
            throw new IllegalArgumentException(
                    "src_position was greater than src array size.  Tried to write starting at position "
                            + src_position + " but the array length is " + src.length);
        if (src_position + length > src.length)
            throw new IllegalArgumentException(
                    "src_position + length would overrun the src array.  Expected end at " + (src_position + length)
                            + " actual end at " + src.length);
        if (dst_position < 0)
            throw new IllegalArgumentException("dst_position was less than 0.  Actual value " + dst_position);
        if (dst_position >= dst.length)
            throw new IllegalArgumentException(
                    "dst_position was greater than dst array size.  Tried to write starting at position "
                            + dst_position + " but the array length is " + dst.length);
        if (dst_position + length > dst.length)
            throw new IllegalArgumentException(
                    "dst_position + length would overrun the dst array.  Expected end at " + (dst_position + length)
                            + " actual end at " + dst.length);

        System.arraycopy(src, src_position, dst, dst_position, length);
    }//from  ww w  .  j a v  a  2  s  .  c o m
}

Related

  1. arrayCopy(byte[] dest, int offset, byte[] in)
  2. arrayCopy(byte[] in, int inOff, int length, byte[] out, int outOff)
  3. arrayCopy(byte[] source, byte[] dest)
  4. arrayCopy(byte[] source, byte[] dest)
  5. arraycopy(byte[] src, int destLen, int len)
  6. arrayCopy(byte[] src, int srcOffset, byte[] target, int targetOffset, int length)
  7. arrayCopy(byte[] src, int srcStart, byte[] dest, int destStart, int destBitOffset, int lengthInBits)
  8. arraycopy(char[] A1, int offset1, char[] A2, int offset2, int length)
  9. arrayCopy(char[] chars)