r""" >>> import io >>> read_uint2(io.BytesIO(b'\xff\x00')) 255 >>> read_uint2(io.BytesIO(b'\xff\xff')) 65535
(f)
| 229 | |
| 230 | |
| 231 | def read_uint2(f): |
| 232 | r""" |
| 233 | >>> import io |
| 234 | >>> read_uint2(io.BytesIO(b'\xff\x00')) |
| 235 | 255 |
| 236 | >>> read_uint2(io.BytesIO(b'\xff\xff')) |
| 237 | 65535 |
| 238 | """ |
| 239 | |
| 240 | data = f.read(2) |
| 241 | if len(data) == 2: |
| 242 | return _unpack("<H", data)[0] |
| 243 | raise ValueError("not enough data in stream to read uint2") |
| 244 | |
| 245 | uint2 = ArgumentDescriptor( |
| 246 | name='uint2', |
nothing calls this directly
no test coverage detected
searching dependent graphs…