MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / peek

Method peek

mitmproxy/io/io.py:33–41  ·  view source on GitHub ↗
(self, n: int)

Source from the content-addressed store, hash-verified

31 self.fo = fo
32
33 def peek(self, n: int) -> bytes:
34 try:
35 return cast(BufferedReader, self.fo).peek(n)
36 except AttributeError:
37 # https://github.com/python/cpython/issues/90533: io.BytesIO does not have peek()
38 pos = self.fo.tell()
39 ret = self.fo.read(n)
40 self.fo.seek(pos)
41 return ret
42
43 def stream(self) -> Iterable[flow.Flow]:
44 """

Callers 1

streamMethod · 0.95

Calls 1

readMethod · 0.45

Tested by

no test coverage detected