| 2356 | return not eof |
| 2357 | |
| 2358 | def _pack_cookie(self, position, dec_flags=0, |
| 2359 | bytes_to_feed=0, need_eof=False, chars_to_skip=0): |
| 2360 | # The meaning of a tell() cookie is: seek to position, set the |
| 2361 | # decoder flags to dec_flags, read bytes_to_feed bytes, feed them |
| 2362 | # into the decoder with need_eof as the EOF flag, then skip |
| 2363 | # chars_to_skip characters of the decoded result. For most simple |
| 2364 | # decoders, tell() will often just give a byte offset in the file. |
| 2365 | return (position | (dec_flags<<64) | (bytes_to_feed<<128) | |
| 2366 | (chars_to_skip<<192) | bool(need_eof)<<256) |
| 2367 | |
| 2368 | def _unpack_cookie(self, bigint): |
| 2369 | rest, position = divmod(bigint, 1<<64) |