public static byte[] copy(byte[] src,byte[] target){
  if (target.length < src.length) {
    target=new byte[src.length];
  }
  System.arraycopy(src,0,target,0,src.length);
  return target;
}

public static byte [ ] copy ( byte [ ] src , byte [ ] target ) { if ( target . length < src . length ) { target = new byte [ src . length ] ; } System . arraycopy ( src , 0 , target , 0 , src . length ) ; return target ; }
copies the src to the target , resizing the target , if necessary
