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