public static byte[] cloneByteArray(byte[] b){
  if (b == null) {
    return null;
  }
  int len=b.length;
  if (len == 0) {
    return EMPTY_BYTES;
  }
  byte[] copy=new byte[len];
  System.arraycopy(b,0,copy,0,len);
  return copy;
}

public static byte [ ] cloneByteArray ( byte [ ] b ) { if ( b == null ) { return null ; } int len = b . length ; if ( len == 0 ) { return EMPTY_BYTES ; } byte [ ] copy = new byte [ len ] ; System . arraycopy ( b , 0 , copy , 0 , len ) ; return copy ; }
create a new byte array and copy all the data . if the size of the byte array is zero , the same array is returned .
