MCPcopy Index your code
hub / github.com/RustPython/RustPython / __read

Method __read

Lib/tarfile.py:567–581  ·  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

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

Callers 2

_init_read_gzMethod · 0.95
_readMethod · 0.95

Calls 4

lenFunction · 0.85
readMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected