אם הבנתי נכון:
הנה קוד:
byte[] array1, array2, result; // put something in those arrays array1 = (new String("first array")).getBytes(); array2 = (new String("second array")).getBytes(); result = new byte[array1.length+array2.length]; int i, len; len = array1.length; // this is a func call therefore we don´t want to put it into the loop for( i=0 ; i < len ; i++) result=array1; int len2 = array2.length; for( ; i < len2 ; i++) result=array2[i-len1];
קוד פשוט, אולי אפשר לפשט אותו אפילו יותר