code: def writeObject(self, obj):
          
          log_debug("Writing object of type {0}".format(type(obj).__name__))
          if isinstance(obj, JavaArray):
              # Deserialized Java array
              self.write_array(obj)
          elif isinstance(obj, JavaEnum):
              # Deserialized Java Enum
              self.write_enum(obj)
          elif isinstance(obj, JavaObject):
              # Deserialized Java object
              self.write_object(obj)
          elif isinstance(obj, JavaString):
              # Deserialized String
              self.write_string(obj)
          elif isinstance(obj, JavaClass):
              # Java class
              self.write_class(obj)
          elif obj is None:
              # Null
              self.write_null()
          elif type(obj) is str:
              # String value
              self.write_blockdata(obj)
          else:
              # Unhandled type
              raise RuntimeError(
                  "Object serialization of type {0} is not "
                  "supported.".format(type(obj))
              )
docs: Appends an object to the serialization stream
  
          :param obj: A string or a deserialized Java object
          :raise RuntimeError: Unsupported type