We will implement writeObject in order to controll
the marshalling for this object.
Note, this is overriding the default implementation of
the Serializable interface.

@see java.io.Serializable
12125
private void writeObject(ObjectOutputStream out) throws IOException
    {
        try
        {
            out.defaultWriteObject();

            // p113380 - start of change
            // write out the header information
            out.write(EYECATCHER);
            out.writeShort(PLATFORM);
            out.writeShort(VERSION_ID);
            // p113380 - end of change

            // write out the common data
            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.writeObject: ivSession = " + ivSession);
            }
            out.writeBoolean(ivSession);

            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.writeObject: ivStatelessSession = " + ivStatelessSession);
            }
            out.writeBoolean(ivStatelessSession);

            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.writeObject: ivBeanClass is " + ivBeanClassName);//184994
            }
            out.writeUTF(ivBeanClassName);//184994

            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.writeObject: ivHomeClass is " + ivHomeClass.getName());
            }
            out.writeUTF(ivHomeClass.getName());

            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.writeObject: ivRemoteClass is " + ivRemoteClass.getName());
            }
            out.writeUTF(ivRemoteClass.getName());

            if (ivSession == false)
            {
                if (DEBUG_ON)
                {
                    System.out.println("EJBMetaDataImpl.writeObject: ivPKClass is " + ivPKClass.getName());
                }
                out.writeUTF(ivPKClass.getName());
            }

            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.writeObject: writing HomeHandle");
            }
            out.writeObject(ivHomeHandle);

            if (DEBUG_ON)
            {
                System.out.println("EJBMetaDataImpl.writeObject normal exit");
            }
        } catch (IOException e)
        {
            // FFDCFilter.processException(e, CLASS_NAME + ".writeObject", "439", this);
            if (DEBUG_ON)
            {
                System.out.println("***ERROR**** EJBMetaDataImpl.readObject caught unexpected exception");
                e.printStackTrace();
            }
            throw e;
        }
    }
904971
private void writeObject(java.io.ObjectOutputStream s) throws IOException  {
    s.defaultWriteObject();     // Nothing to write
    for( Object K : keySet() ) {
      final Object V = get(K);  // Do an official 'get'
      s.writeObject(K);         // Write the <TypeK,TypeV> pair
      s.writeObject(V);
    }
    s.writeObject(null);        // Sentinel to indicate end-of-data
    s.writeObject(null);
  }
834116
private void writeObject(ObjectOutputStream out) throws IOException {
        Storable s = mStorable;
        if (s == null) {
            out.write(0);
        } else {
            out.write(1);
            out.writeObject(s.storableType());
            try {
                s.writeTo(out);
            } catch (SupportException e) {
                throw new IOException(e);
            }
        }
    }
1031036
private void writeObject(ObjectOutputStream out) throws IOException {
        logger.info("Serialization requested, awaiting reference to load.");
        get();
        out.defaultWriteObject();
        logger.info("Serialization finished!");
    }
935876
private void writeObject(ObjectOutputStream out) throws IOException {
		// serialize the parent fields and the final fields
		out.defaultWriteObject();

		// write the input split
		((Writable) mapreduceInputSplit).write(out);
	}
233302
public <TYPE> void write(@NotNull final TYPE obj, @NotNull final Writer writer, @NotNull final JAXBContext jaxbContext)
            throws MarshalObjectException {

        Contract.requireArgNotNull("obj", obj);
        Contract.requireArgNotNull("writer", writer);
        Contract.requireArgNotNull("jaxbContext", jaxbContext);

        try {
            final Marshaller marshaller = jaxbContext.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, formattedOutput);
            marshaller.marshal(obj, writer);
        } catch (final JAXBException ex) {
            throw new MarshalObjectException("Unable to write XML to writer", ex);
        }
    }
633171
private void writeObject(final ObjectOutputStream out)
		throws IOException
	{
		out.defaultWriteObject();

		out.writeInt(_length);
		out.writeDouble(_p);
		out.writeInt(_genes.length);
		out.write(_genes);
	}
548616
@GwtIncompatible("ObjectOutputStream")
  public void serialize(OutputStream objectOutputStream) throws IOException {
    new java.io.ObjectOutputStream(objectOutputStream).writeObject(this);
  }
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();
		}
	}
940572
private void writeObject(java.io.ObjectOutputStream out) throws IOException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "writeObject : " + this); // d468174

        out.writeObject(ivPuRefId);
        out.writeObject(ivJ2eeName); // d510184
        out.writeObject(ivRefName); // d510184
        out.writeObject(ivProperties);
        out.writeBoolean(ivUnsynchronized);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "writeObject : " + this);
    }
1135595
private void writeObject(java.io.ObjectOutputStream out)
                    throws IOException
    {
        out.defaultWriteObject();
        out.write(frciEyecatcher);
        out.writeShort(frciPlatform);
        out.writeShort(frciVersionID);
    }
5601
@Override
    public void writeObject(Object object)
        throws IOException
    {
        if (object == null) {
            writeNull();
            return;
        }

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

        serializer.writeObject(object, this);
    }
877370
public <TYPE> String write(@NotNull final TYPE obj, @NotNull final JAXBContext jaxbContext) throws MarshalObjectException {

        Contract.requireArgNotNull("obj", obj);
        Contract.requireArgNotNull("jaxbContext", jaxbContext);

        final StringWriter writer = new StringWriter();
        write(obj, writer, jaxbContext);
        return writer.toString();
    }
994377
private void writeObject(java.io.ObjectOutputStream out) throws IOException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "writeObject : " + ivPuId + ", " + ivJ2eeName);

        out.writeObject(ivPuId);
        out.writeObject(ivJ2eeName); // d510184

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "writeObject");
    }
850579
public final void writeObject(java.io.DataOutputStream dataOutputStream)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass,
                        "writeObject",
                        "dataOutputStream=" + dataOutputStream);

        try {
            dataOutputStream.writeByte(SimpleSerialVersion);
            super.writeObject(dataOutputStream);

            dataOutputStream.writeInt(activeSubListCount);
            for (int i = 0; i < subListTokens.length; i++) {
                subListTokens[i].writeObject(dataOutputStream);
            } // for subLists.

        } catch (java.io.IOException exception) {
            // No FFDC Code Needed.
            ObjectManager.ffdc.processException(this,
                                                cclass,
                                                "writeObject",
                                                exception,
                                                "1:1229:1.26");

            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this, cclass
                           , "writeObject"
                           , "via PermanentIOException"
                                );
            throw new PermanentIOException(this,
                                           exception);
        } // catch (java.io.IOException exception).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass,
                       "writeObject");
    }
1018130
private synchronized void writeObject(java.io.ObjectOutputStream s)
        throws java.io.IOException {
        java.io.ObjectOutputStream.PutField fields = s.putFields();
        fields.put("value", getValue());
        fields.put("count", length());
        fields.put("shared", false);
        s.writeFields();
    }
978174
@Override
	public void writeObject(Object o)
	{
		synchronized (this)
		{
			ArrayList<Object> prePending = objPrePendingCache.get(o);
			if (prePending == null)
			{
				boolean oldWritingObject = writingObject;
				writingObject = true;
				try
				{
					super.writeObject(o);
				}
				finally
				{
					writingObject = oldWritingObject;
				}
			}
			else
			{
				flushPrePending.clear();
				flushPrePending.addAll(prePending);
			}

			// root object
			if (!writingObject)
			{
				boolean isNotCached = prePending == null;
				// is not cached, add to cache
				if (isNotCached && o != null)
				{
					prePending = new ArrayList<Object>();
					prePending.addAll(flushPrePending);
					objPrePendingCache.put(o, prePending);
				}

				// add to pending
				flushPending.addAll(flushPrePending);
				flushPendingStat.addAll(flushPrePending);
				flushPrePending.clear();

				if (isNotCached && flushPending.contains(o))
				{
					flushPendingStat.remove(o);
				}
				else
				{
					flushPending.add(o);
				}
				if (needOwner)
				{
					this.flushPending.remove(owner);
					this.flushPending.add(0, owner);
				}
			}
		}
	}