@classmethod<EOL><INDENT>def parse(cls, fptr, offset, length):<DEDENT>
num_bytes = offset + length - fptr.tell()<EOL>read_buffer = fptr.read(num_bytes)<EOL>(brand, minor_version) = struct.unpack_from('<STR_LIT>', read_buffer, <NUM_LIT:0>)<EOL>if sys.hexversion >= <NUM_LIT>:<EOL><INDENT>brand = brand.decode('<STR_LIT:utf-8>')<EOL><DEDENT>num_entries = int((length - <NUM_LIT:16>) / <NUM_LIT:4>)<EOL>compatibility_list = []<EOL>for j in range(int(num_entries)):<EOL><INDENT>entry, = struct.unpack_from('<STR_LIT>', read_buffer, <NUM_LIT:8> + j * <NUM_LIT:4>)<EOL>if sys.hexversion >= <NUM_LIT>:<EOL><INDENT>try:<EOL><INDENT>entry = entry.decode('<STR_LIT:utf-8>')<EOL><DEDENT>except UnicodeDecodeError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>compatibility_list.append(entry)<EOL><DEDENT>return cls(brand=brand, minor_version=minor_version,<EOL>compatibility_list=compatibility_list,<EOL>length=length, offset=offset)<EOL>
Parse JPEG 2000 file type box.

        Parameters
        ----------
        f : file
            Open file object.
        offset : int
            Start position of box in bytes.
        length : int
            Length of the box in bytes.

        Returns
        -------
        FileTypeBox
            Instance of the current file type box.