def readUntilNull(s):
    """
    Read a string until a null is encountered

    returns (string up to null , remainder after null)
    """
    item = s.split(b'\0' , 1)
    if len(item) == 1:
        return (item[0] , None)
    else:
        return (item[0] , item[1])