(stream, fmt)
| 11 | l = len(s) |
| 12 | return struct.pack(">H%dsb" % l, l, s.encode('utf8'), 0) |
| 13 | def unpack(stream, fmt): |
| 14 | size = struct.calcsize(fmt) |
| 15 | buf = stream.read(size) |
| 16 | return struct.unpack(fmt, buf) |
| 17 | def unpack_string(stream): |
| 18 | size, = unpack(stream, ">h") |
| 19 | if size == -1: # null string |
no outgoing calls
no test coverage detected