Return size bytes from stream. If internal buffer is empty, read another block from the stream.
(self, size)
| 563 | return t[:size] |
| 564 | |
| 565 | def __read(self, size): |
| 566 | """Return size bytes from stream. If internal buffer is empty, |
| 567 | read another block from the stream. |
| 568 | """ |
| 569 | c = len(self.buf) |
| 570 | t = [self.buf] |
| 571 | while c < size: |
| 572 | buf = self.fileobj.read(self.bufsize) |
| 573 | if not buf: |
| 574 | break |
| 575 | t.append(buf) |
| 576 | c += len(buf) |
| 577 | t = b"".join(t) |
| 578 | self.buf = t[size:] |
| 579 | return t[:size] |
| 580 | # class _Stream |
| 581 | |
| 582 | class _StreamProxy(object): |
no test coverage detected