MCPcopy Index your code
hub / github.com/python/cpython / __read

Method __read

Lib/tarfile.py:565–579  ·  view source on GitHub ↗

Return size bytes from stream. If internal buffer is empty, read another block from the stream.

(self, size)

Source from the content-addressed store, hash-verified

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
582class _StreamProxy(object):

Callers 2

_init_read_gzMethod · 0.95
_readMethod · 0.95

Calls 3

readMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected