int[] dest = new int[0];
int[] value = {1,2};
if(value != null && value.length>0)
{
int[] tmp = dest;
dest = new int[value.length+tmp.length];
System.arraycopy(tmp, 0, dest, 0, tmp.length);
System.arraycopy(value, 0, dest, tmp.length, value.length);
}
int[] value2 = {3,4};
if(value2 != null && value2.length>0)
{
int[] tmp = dest;
dest = new int[value2.length+tmp.length];
System.arraycopy(tmp, 0, dest, 0, tmp.length);
System.arraycopy(value2, 0, dest, tmp.length, value2.length);
}
原文地址:http://www.cnblogs.com/kevinge/p/3850808.html