Use copyArray instead of copyBytes