Use System.arraycopy for efficiency