Read until EOF, using multiple read() call.
(self)
| 623 | return b.take_bytes() |
| 624 | |
| 625 | def readall(self): |
| 626 | """Read until EOF, using multiple read() call.""" |
| 627 | res = bytearray() |
| 628 | while data := self.read(DEFAULT_BUFFER_SIZE): |
| 629 | res += data |
| 630 | if res: |
| 631 | return res.take_bytes() |
| 632 | else: |
| 633 | # b'' or None |
| 634 | return data |
| 635 | |
| 636 | def readinto(self, b): |
| 637 | """Read bytes into a pre-allocated bytes-like object b. |
no test coverage detected