code: def write(self, fptr):
          
          self._validate(writing=True)
          num_components = len(self.association)
          fptr.write(struct.pack('>I4s', 8 + 2 + num_components * 6, b'cdef'))
          fptr.write(struct.pack('>H', num_components))
          for j in range(num_components):
              fptr.write(struct.pack('>' + 'H' * 3,
                                     self.index[j],
                                     self.channel_type[j],
                                     self.association[j]))
docs: Write a channel definition box to file.