Writes an object header to the serialization stream

        :param obj: Not yet used
        :param parent: Not yet used
339334
def write_object(self, obj, parent=None):
        
        # Transform object
        for transformer in self.object_transformers:
            tmp_object = transformer.transform(obj)
            if tmp_object is not obj:
                obj = tmp_object
                break

        self._writeStruct(">B", 1, (self.TC_OBJECT,))
        cls = obj.get_class()
        self.write_classdesc(cls)

        # Add reference
        self.references.append([])
        logging.debug(
            "*** Adding ref 0x%X for object %s",
            len(self.references) - 1 + self.BASE_REFERENCE_IDX,
            obj,
        )

        all_names = collections.deque()
        all_types = collections.deque()
        tmpcls = cls
        while tmpcls:
            all_names.extendleft(reversed(tmpcls.fields_names))
            all_types.extendleft(reversed(tmpcls.fields_types))
            tmpcls = tmpcls.superclass
        del tmpcls

        logging.debug("<=> Field names: %s", all_names)
        logging.debug("<=> Field types: %s", all_types)

        for field_name, field_type in zip(all_names, all_types):
            try:
                logging.debug(
                    "Writing field %s (%s): %s",
                    field_name,
                    field_type,
                    getattr(obj, field_name),
                )
                self._write_value(field_type, getattr(obj, field_name))
            except AttributeError as ex:
                log_error(
                    "No attribute {0} for object {1}\nDir: {2}".format(
                        ex, repr(obj), dir(obj)
                    )
                )
                raise
        del all_names, all_types

        if (
            cls.flags & self.SC_SERIALIZABLE
            and cls.flags & self.SC_WRITE_METHOD
            or cls.flags & self.SC_EXTERNALIZABLE
            and cls.flags & self.SC_BLOCK_DATA
        ):
            for annotation in obj.annotations:
                log_debug(
                    "Write annotation {0} for {1}".format(repr(annotation), repr(obj))
                )
                if annotation is None:
                    self.write_null()
                else:
                    self.writeObject(annotation)
            self._writeStruct(">B", 1, (self.TC_ENDBLOCKDATA,))
372053
private void writeObject(ObjectOutputStream oos) throws IOException
   {
      ObjectOutputStream.PutField fields =  oos.putFields();
      String name = serialPersistentFields[ID_IDX].getName();
      fields.put(name, id);
      name = serialPersistentFields[EXCEPTION_IDX].getName();
      fields.put(name, e);
      name = serialPersistentFields[CONN_HANDLE_IDX].getName();
      fields.put(name, connectionHandle);
      oos.writeFields();
   }
796078
private void writeObject(final ObjectOutputStream out)
		throws IOException
	{
		out.defaultWriteObject();
		out.writeLong(getGeneration());
		out.writeObject(getGenotype());
		out.writeObject(getFitness());
		out.writeObject(getRawFitness());
	}
1296163
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
        // Write out capacity and any hidden stuff
        s.defaultWriteObject();
    }
603109
private void writeObject(ObjectOutputStream out) throws IOException {
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "writeObject",
                     new Object[] { "caller/invocation subjects:", callerSubject, invocationSubject, "jaasLoginContextEntry:", jaasLoginContextEntry });

        PutField fields = out.putFields();

        if (callerSubject != null && !subjectHelper.isUnauthenticated(callerSubject)) {
            fields.put(CALLER_PRINCIPAL, getWSPrincipal(callerSubject));
        }

        subjectsAreEqual = areSubjectsEqual(callerSubject, invocationSubject);
        fields.put(SUBJECTS_ARE_EQUAL, subjectsAreEqual);

        //only serialize invocation principal if it's different from the caller
        if (!subjectsAreEqual) {
            if (invocationSubject != null && !subjectHelper.isUnauthenticated(invocationSubject)) {
                fields.put(INVOCATION_PRINCIPAL, getWSPrincipal(invocationSubject));
            }
        }

        if (jaasLoginContextEntry != null) {
            fields.put(JAAS_LOGIN_CONTEXT, jaasLoginContextEntry);
        }

        // Serialize Subject Cache key
        try {
            serializeSubjectCacheKey(fields);
        } catch (Exception e) {
            if (tc.isDebugEnabled())
                Tr.debug(tc, "Unable to serialize Subject Cache Key: " + e.getMessage());
            if (tc.isWarningEnabled())
                Tr.warning(tc, SEC_CONTEXT_UNABLE_TO_SERIALIZE);
        }

        out.writeFields();

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "writeObject", new Object[] { "subjects are equal: ", subjectsAreEqual });
    }
5601
@Override
    public void writeObject(Object object)
        throws IOException
    {
        if (object == null) {
            writeNull();
            return;
        }

        Serializer serializer = findSerializerFactory().getObjectSerializer(object.getClass());

        serializer.writeObject(object, this);
    }
1188899
protected void writeArbitraryObject(Object object) {
        log.debug("writeObject");
        // If we need to serialize class information...
        Class<?> objectClass = object.getClass();
        if (!objectClass.isAnnotationPresent(Anonymous.class)) {
            // Write out start object marker for class name
            buf.put(AMF.TYPE_CLASS_OBJECT);
            putString(buf, Serializer.getClassName(objectClass));
        } else {
            // Write out start object marker without class name
            buf.put(AMF.TYPE_OBJECT);
        }
        // Iterate thru fields of an object to build "name-value" map from it
        for (Field field : objectClass.getFields()) {
            String fieldName = field.getName();
            log.debug("Field: {} class: {}", field, objectClass);
            // Check if the Field corresponding to the getter/setter pair is transient
            if (!serializeField(objectClass, fieldName, field, null)) {
                continue;
            }
            Object value;
            try {
                // Get field value
                value = field.get(object);
            } catch (IllegalAccessException err) {
                // Swallow on private and protected properties access exception
                continue;
            }
            // Write out prop name
            putString(buf, fieldName);
            // Write out
            Serializer.serialize(this, field, null, object, value);
        }
        // write out end of object marker
        buf.put(AMF.END_OF_OBJECT_SEQUENCE);
    }
980650
public void marshal(Object obj, HierarchicalStreamWriter writer,
			MarshallingContext context) {
		XLog log = (XLog) obj;

		writer.startNode("XExtensions");
		context.convertAnother(log.getExtensions());
		writer.endNode();

		writer.startNode("XAttributeMap");
		context.convertAnother(log.getAttributes(), XesXStreamPersistency.attributeMapConverter);
		writer.endNode();

		writer.startNode("XGlobalTraceAttributes");
		context.convertAnother(log.getGlobalTraceAttributes());
		writer.endNode();

		writer.startNode("XGlobalEventAttributes");
		context.convertAnother(log.getGlobalEventAttributes());
		writer.endNode();

		writer.startNode("XEventClassifiers");
		context.convertAnother(log.getClassifiers());
		writer.endNode();

		for (XTrace trace : log) {
			writer.startNode("XTrace");
			context.convertAnother(trace,  XesXStreamPersistency.traceConverter);
			writer.endNode();
		}
	}
1094379
public void writeObject (Output output, Object object) {
		if (output == null) throw new IllegalArgumentException("output cannot be null.");
		if (object == null) throw new IllegalArgumentException("object cannot be null.");
		beginObject();
		try {
			if (references && writeReferenceOrNull(output, object, false)) return;
			if (TRACE || (DEBUG && depth == 1)) log("Write", object, output.position());
			getRegistration(object.getClass()).getSerializer().write(this, output, object);
		} finally {
			if (--depth == 0 && autoReset) reset();
		}
	}
1066238
private void writeObject(java.io.ObjectOutputStream s)
            throws java.io.IOException {
        s.defaultWriteObject();

        // Write out size
        s.writeInt(size());

        // Write out elements in order.
        int mask = elements.length - 1;
        for (int i = head; i != tail; i = (i + 1) & mask)
            s.writeObject(elements[i]);
    }
593946
final void writeHeader()
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "writeHeader");

        byteArrayOutputStream.reset();
        java.io.DataOutputStream dataOutputStream = new java.io.DataOutputStream(byteArrayOutputStream);

        // Write the header.
        try {
            dataOutputStream.writeInt(version);
            dataOutputStream.writeChars(signature);
            dataOutputStream.writeLong(objectStoreIdentifier);
            dataOutputStream.writeLong(((Directory.Node) directory.root).byteAddress);
            dataOutputStream.writeLong(((Directory.Node) directory.root).length);
            dataOutputStream.writeInt(directory.getMinimumNodeSize());
            if (freeSpaceStoreArea == null) {
                dataOutputStream.writeLong(0);
                dataOutputStream.writeLong(0);
            } else {
                dataOutputStream.writeLong(freeSpaceStoreArea.byteAddress);
                dataOutputStream.writeLong(freeSpaceStoreArea.length);
            }
            dataOutputStream.writeLong((long) freeSpaceByLength.size());
            dataOutputStream.writeLong(sequenceNumber);
            dataOutputStream.writeLong(storeFileSizeUsed);
            dataOutputStream.writeLong(minimumStoreFileSize);
            dataOutputStream.writeLong(maximumStoreFileSize);
            dataOutputStream.writeInt(cachedManagedObjectsSize);

            dataOutputStream.flush();
            byteArrayOutputStream.flush();
        } catch (java.io.IOException exception) {
            // No FFDC Code Needed.
            ObjectManager.ffdc.processException(this, cclass, "writeHeader", exception, "1:836:1.35");

            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this,
                           cclass,
                           "flush");
            throw new PermanentIOException(this,
                                           exception);
        } // catch.

        byte[] buffer = byteArrayOutputStream.getBuffer();
        int length = byteArrayOutputStream.getCount();
        writeBuffer(buffer,
                    0,
                    length,
                    0);
        // Write the header twice.
        writeBuffer(buffer,
                    0,
                    length,
                    pageSize);

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       "writeHeader"
                            );
    }
49179
public void writeObject (Output output, Object object, Serializer serializer) {
		if (output == null) throw new IllegalArgumentException("output cannot be null.");
		if (object == null) throw new IllegalArgumentException("object cannot be null.");
		if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
		beginObject();
		try {
			if (references && writeReferenceOrNull(output, object, false)) return;
			if (TRACE || (DEBUG && depth == 1)) log("Write", object, output.position());
			serializer.write(this, output, object);
		} finally {
			if (--depth == 0 && autoReset) reset();
		}
	}
193591
private void writeObject(ObjectOutputStream out) throws IOException {
        out.defaultWriteObject();
        out.writeInt(severity.getOrdinal());
        out.writeObject(summary);
        out.writeObject(detail);
        out.writeObject(rendered);
    }
381420
public void writeHeader( DataOutputStream out ) 
                           throws IOException { 
    out.writeByte( type );
    out.writeInt( bytesPerChecksum );
  }
961658
@Override
    public void writeObject(Object obj, AbstractHessianOutput out)
        throws IOException
    {
        if (out.addRef(obj)) {
            return;
        }

        int ref = out.writeObjectBegin(getClassName(obj));

        if (ref < -1) {
            out.writeString("value");

            InputStream is = null;

            try {
                is = getInputStream(obj);
            } catch (Exception e) {
                log.log(Level.WARNING, e.toString(), e);
            }

            if (is != null) {
                try {
                    out.writeByteStream(is);
                } finally {
                    is.close();
                }
            } else {
                out.writeNull();
            }

            out.writeMapEnd();
        }
        else {
            if (ref == -1) {
                out.writeClassFieldLength(1);
                out.writeString("value");

                out.writeObjectBegin(getClassName(obj));
            }

            InputStream is = null;

            try {
                is = getInputStream(obj);
            } catch (Exception e) {
                log.log(Level.WARNING, e.toString(), e);
            }

            try {
                if (is != null)
                    out.writeByteStream(is);
                else
                    out.writeNull();
            } finally {
                if (is != null)
                    is.close();
            }
        }
    }
528344
def serialize(cls, obj):
        

        cls._initialize()
        serializer = cls._get_serializer(type(obj))

        if serializer == cls:
            return cls._serialize_default(obj)
        else:
            return serializer.serialize(obj)
711530
public void marshal(Object obj, HierarchicalStreamWriter writer,
			MarshallingContext context) {
		XAttribute attribute = (XAttribute) obj;
		writer.addAttribute("key", attribute.getKey());
		writer.addAttribute("type", XAttributeUtils.getTypeString(attribute));
		String value = attribute.toString();
		if (value == null) {
			throw new AssertionError("Attribute value must not be null");
		}
		writer.addAttribute("value", value);
		if (attribute.getExtension() != null) {
			writer.addAttribute("extension", attribute.getExtension().getUri()
					.toString());
		}
		// marshal meta-attributes
		if (attribute.getAttributes().size() > 0) {
			writer.startNode("XAttributeMap");
			XAttribute oldParent = (XAttribute) context.get(PARENT);
			context.put(PARENT, attribute); 
			context.convertAnother(attribute.getAttributes(),
					XesXStreamPersistency.attributeMapConverter);
			context.put(PARENT, oldParent);
			writer.endNode();
		}
	}