function copyBytes(fromArray, fromPos, toArray, toPos, length) {
  for (let i = 0; i < length; i++) {
    toArray[toPos + i] = fromArray[fromPos + i]
  }
}
Copy bytes from one array to another

@param {Uint8Array} fromArray source array
@param {number} fromPos source position
@param {Uint8Array} toArray destination array
@param {number} toPos destination position
@param {number} length number of bytes to copy