Using System.arraycopy for better perfomance.