@classmethod
def read_null_terminated(cls, fobj):
    """Read a null-terminated string."""
    result = ''
    while True:
        char = fobj.read(1)
        if not char or char == '\x00':
            break
        result += char
    return result
