r""" >>> import io >>> read_long1(io.BytesIO(b"\x00")) 0 >>> read_long1(io.BytesIO(b"\x02\xff\x00")) 255 >>> read_long1(io.BytesIO(b"\x02\xff\x7f")) 32767 >>> read_long1(io.BytesIO(b"\x02\x00\xff")) -256 >>> read_long1(io.BytesIO(b"\x02\x00\x80")) -32768
(f)
| 871 | from pickle import decode_long |
| 872 | |
| 873 | def read_long1(f): |
| 874 | r""" |
| 875 | >>> import io |
| 876 | >>> read_long1(io.BytesIO(b"\x00")) |
| 877 | 0 |
| 878 | >>> read_long1(io.BytesIO(b"\x02\xff\x00")) |
| 879 | 255 |
| 880 | >>> read_long1(io.BytesIO(b"\x02\xff\x7f")) |
| 881 | 32767 |
| 882 | >>> read_long1(io.BytesIO(b"\x02\x00\xff")) |
| 883 | -256 |
| 884 | >>> read_long1(io.BytesIO(b"\x02\x00\x80")) |
| 885 | -32768 |
| 886 | """ |
| 887 | |
| 888 | n = read_uint1(f) |
| 889 | data = f.read(n) |
| 890 | if len(data) != n: |
| 891 | raise ValueError("not enough data in stream to read long1") |
| 892 | return decode_long(data) |
| 893 | |
| 894 | long1 = ArgumentDescriptor( |
| 895 | name="long1", |
nothing calls this directly
no test coverage detected
searching dependent graphs…