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

Function _read_exact

tools/python-3.11.9-amd64/Lib/gzip.py:402–415  ·  view source on GitHub ↗

Read exactly *n* bytes from `fp` This method is required because fp may be unbuffered, i.e. return short reads.

(fp, n)

Source from the content-addressed store, hash-verified

400
401
402def _read_exact(fp, n):
403 '''Read exactly *n* bytes from `fp`
404
405 This method is required because fp may be unbuffered,
406 i.e. return short reads.
407 '''
408 data = fp.read(n)
409 while len(data) < n:
410 b = fp.read(n - len(data))
411 if not b:
412 raise EOFError("Compressed file ended before the "
413 "end-of-stream marker was reached")
414 data += b
415 return data
416
417
418def _read_gzip_header(fp):

Callers 2

_read_gzip_headerFunction · 0.85
_read_eofMethod · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected