def deframe_longstr(buf, offset):  # -> value, bytes_eaten
    ln, = _frombuf('!I', buf, offset)
    return buf[offset + 4:offset + 4 + ln], 4 + ln