code: def write(self, fptr):
          
          length = 8 + 4 * len(self.component_index)
          write_buffer = struct.pack('>I4s', length, b'cmap')
          fptr.write(write_buffer)
  
          for j in range(len(self.component_index)):
              write_buffer = struct.pack('>HBB',
                                         self.component_index[j],
                                         self.mapping_type[j],
                                         self.palette_index[j])
              fptr.write(write_buffer)
docs: Write a Component Mapping box to file.