API 7 compatibility: avoid Arrays.copyOf