public static byte [ ] combine ( final Collection < byte [ ] > arrays ) { int length = 0 ; for ( final byte [ ] array : arrays ) { length += array . length ; } final byte [ ] joinedArray = new byte [ length ] ; int position = 0 ; for ( final byte [ ] array : arrays ) { System . arraycopy ( array , 0 , joinedArray , position , array . length ) ; position += array . length ; } return joinedArray ; }
Combines the specified arrays into a single array .