replace manual array content copying with System.arraycopy()