<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _on_ready_read(self):
 """ Read bytes when ready read """

        while self.bytesAvailable():
            if not self._header_complete:
                self._read_header()
            else:
                self._read_payload()