'Determines whether the file is a valid ms2 file.'

def sniff(self, filename):

    with open(filename, 'r') as contents:
        header_lines = []
        while True:
            line = contents.readline()
            if ((line is None) or (len(line) == 0)):
                pass
            elif line.startswith('H DCTB '):
                header_lines.append(line)
            else:
                break
    for header_field in ['CreationDate', 'Extractor', 'ExtractorVersion', 'ExtractorOptions']:
        found_header = False
        for header_line in header_lines:
            if header_line.startswith(('H DCTB %s' % header_field)):
                found_header = True
                break
        if (not found_header):
            return False
    return True
