code: def write_enum(self, obj):
          
          # FIXME: the output doesn't have the same references as the real
          # serializable form
          self._writeStruct(">B", 1, (self.TC_ENUM,))
  
          try:
              idx = self.references.index(obj)
          except ValueError:
              # New reference
              self.references.append(obj)
              logging.debug(
                  "*** Adding ref 0x%X for enum: %s",
                  len(self.references) - 1 + self.BASE_REFERENCE_IDX,
                  obj,
              )
  
              self.write_classdesc(obj.get_class())
          else:
              self.write_reference(idx)
  
          self.write_string(obj.constant)
docs: Writes an Enum value
  
          :param obj: A JavaEnum object