replace ArrayUtil to Arrays and System.arraycopy.