public static byte[] copy(byte[] source,byte[] target){
  int len=source.length;
  if (len > target.length) {
    target=new byte[len];
  }
  System.arraycopy(source,0,target,0,len);
  return target;
}

public static byte [ ] copy ( byte [ ] source , byte [ ] target ) { int len = source . length ; if ( len > target . length ) { target = new byte [ len ] ; } System . arraycopy ( source , 0 , target , 0 , len ) ; return target ; }
copy the contents of the source array to the target array . if the size if the target array is too small , a larger array is created .
