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

Method _pack_cookie

tools/python-3.11.9-amd64/Lib/_pyio.py:2323–2331  ·  view source on GitHub ↗
(self, position, dec_flags=0,
                           bytes_to_feed=0, need_eof=False, chars_to_skip=0)

Source from the content-addressed store, hash-verified

2321 return not eof
2322
2323 def _pack_cookie(self, position, dec_flags=0,
2324 bytes_to_feed=0, need_eof=False, chars_to_skip=0):
2325 # The meaning of a tell() cookie is: seek to position, set the
2326 # decoder flags to dec_flags, read bytes_to_feed bytes, feed them
2327 # into the decoder with need_eof as the EOF flag, then skip
2328 # chars_to_skip characters of the decoded result. For most simple
2329 # decoders, tell() will often just give a byte offset in the file.
2330 return (position | (dec_flags<<64) | (bytes_to_feed<<128) |
2331 (chars_to_skip<<192) | bool(need_eof)<<256)
2332
2333 def _unpack_cookie(self, bigint):
2334 rest, position = divmod(bigint, 1<<64)

Callers 1

tellMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected