Replaced loops with System.arraycopy() calls.