Here you can find the source of arraycopy(byte[] src, int src_position, byte[] dst, int dst_position, int length)
public static void arraycopy(byte[] src, int src_position, byte[] dst, int dst_position, int length)
//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 }