This could be simplified to `payloadBytes = bytes.slice(headerLength, headerLength + payload.byteLength)`