copyTo method
Copies a portion of this array to another array.
srcPos
the starting position in this array
dest
the destination array
destPos
the starting position in the destination array
length
the number of bytes to copy
Implementation
void copyTo(int srcPos, ByteArray dest, int destPos, int length) {
for (int i = 0; i < length; i++) {
dest.set(destPos + i, get(srcPos + i));
}
}