public static byte[] clone(byte[] array){
  if (array == null) {
    return null;
  }
  byte[] result=new byte[array.length];
  System.arraycopy(array,0,result,0,array.length);
  return result;
}

public static byte [ ] clone ( byte [ ] array ) { if ( array == null ) { return null ; } byte [ ] result = new byte [ array . length ] ; System . arraycopy ( array , 0 , result , 0 , array . length ) ; return result ; }
return a clone of the given byte array ( performs null check beforehand ) .
