Changed Platform.arraycopy to System.arraycopy