def write(self, fptr):
length = <NUM_LIT:8> + <NUM_LIT:4> * len(self.component_index)<EOL>write_buffer = struct.pack('<STR_LIT>', length, b'<STR_LIT>')<EOL>fptr.write(write_buffer)<EOL>for j in range(len(self.component_index)):<EOL><INDENT>write_buffer = struct.pack('<STR_LIT>',<EOL>self.component_index[j],<EOL>self.mapping_type[j],<EOL>self.palette_index[j])<EOL>fptr.write(write_buffer)<EOL><DEDENT>
Write a Component Mapping box to file.