MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / read_binary

Method read_binary

tools/python-3.11.9-amd64/Lib/cgi.py:694–709  ·  view source on GitHub ↗

Internal: read binary data.

(self)

Source from the content-addressed store, hash-verified

692 bufsize = 8*1024 # I/O buffering size for copy to file
693
694 def read_binary(self):
695 """Internal: read binary data."""
696 self.file = self.make_file()
697 todo = self.length
698 if todo >= 0:
699 while todo > 0:
700 data = self.fp.read(min(todo, self.bufsize)) # bytes
701 if not isinstance(data, bytes):
702 raise ValueError("%s should return bytes, got %s"
703 % (self.fp, type(data).__name__))
704 self.bytes_read += len(data)
705 if not data:
706 self.done = -1
707 break
708 self.file.write(data)
709 todo = todo - len(data)
710
711 def read_lines(self):
712 """Internal: read lines until EOF or outerboundary."""

Callers 1

read_singleMethod · 0.95

Calls 5

make_fileMethod · 0.95
minFunction · 0.85
typeClass · 0.50
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected