MCPcopy
hub / github.com/pallets/werkzeug / readall

Method readall

src/werkzeug/wsgi.py:582–599  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

580 return out_size
581
582 def readall(self) -> bytes:
583 if self.is_exhausted:
584 self.on_exhausted()
585 return b""
586
587 out = bytearray()
588
589 # The parent implementation uses "while True", which results in an extra read.
590 while not self.is_exhausted:
591 data = self.read(1024 * 64)
592
593 # Stream may return empty before a max limit is reached.
594 if not data:
595 break
596
597 out.extend(data)
598
599 return bytes(out)
600
601 def tell(self) -> int:
602 """Return the current stream position.

Callers 1

exhaustMethod · 0.95

Calls 3

on_exhaustedMethod · 0.95
readMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected