(stream, fmt)
| 17 | l = len(s) |
| 18 | return struct.pack(">H%dsb" % l, l, s.encode('utf8'), 0) |
| 19 | def unpack(stream, fmt): |
| 20 | size = struct.calcsize(fmt) |
| 21 | buf = stream.read(size) |
| 22 | return struct.unpack(fmt, buf) |
| 23 | def unpack_string(stream): |
| 24 | size, = unpack(stream, ">h") |
| 25 | if size == -1: # null string |
no outgoing calls
no test coverage detected