Improved performance in copy using System.arraycopy