Optimize for loop by use of System.arraycopy instead

Optimize for loop by use of `System.arraycopy` instead