r""" >>> import io >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x00")) 255 >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x7f")) 32767 >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\xff")) -256 >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\x80")) -32768
(f)
| 903 | """) |
| 904 | |
| 905 | def read_long4(f): |
| 906 | r""" |
| 907 | >>> import io |
| 908 | >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x00")) |
| 909 | 255 |
| 910 | >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x7f")) |
| 911 | 32767 |
| 912 | >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\xff")) |
| 913 | -256 |
| 914 | >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\x80")) |
| 915 | -32768 |
| 916 | >>> read_long1(io.BytesIO(b"\x00\x00\x00\x00")) |
| 917 | 0 |
| 918 | """ |
| 919 | |
| 920 | n = read_int4(f) |
| 921 | if n < 0: |
| 922 | raise ValueError("long4 byte count < 0: %d" % n) |
| 923 | data = f.read(n) |
| 924 | if len(data) != n: |
| 925 | raise ValueError("not enough data in stream to read long4") |
| 926 | return decode_long(data) |
| 927 | |
| 928 | long4 = ArgumentDescriptor( |
| 929 | name="long4", |
nothing calls this directly
no test coverage detected
searching dependent graphs…