/*
(non-Javadoc)

@see SimplifiedSerialization.writeObject(java.io.DataInputStream)
975604
public final void writeObject(java.io.DataOutputStream dataOutputStream)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "writeObject",
                        new Object[] { dataOutputStream });

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

            if (comparator == null) {
                dataOutputStream.writeByte(0);
            } else {
                dataOutputStream.writeByte(1);
                java.io.ObjectOutputStream objectOutputStream = new java.io.ObjectOutputStream(dataOutputStream);
                objectOutputStream.writeObject(comparator);
                objectOutputStream.close();
            } // if (head == null).
            if (root == null) {
                dataOutputStream.writeByte(0);
            } else {
                dataOutputStream.writeByte(1);
                root.writeObject(dataOutputStream);
            } // if (root == null).
            dataOutputStream.writeLong(size);

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

            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this,
                           cclass,
                           "writeObject",
                           exception);

            throw new PermanentIOException(this,
                                           exception);
        } // catch (java.io.IOException exception).

        // Did we exceed the size limits?
        // Check comparator did not cause us to exceed maximum serialized length.
        if (dataOutputStream.size() > maximumSerializedSize())
        {
            if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled())
                trace.debug(this,
                            cclass,
                            "writeObject",
                            new Object[] { new Long(maximumSerializedSize()),
                                          new Integer(dataOutputStream.size()) });
            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this, cclass
                           , "writeObject"
                           , "via SimplifiedSerializationSizeException"
                                );

            throw new SimplifiedSerializationSizeException(this,
                                                           maximumSerializedSize(),
                                                           dataOutputStream.size());
        } // if (dataOutputStream.size() > maximumSerializedSize())    

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       "writeObject");
    }
181208
@Override
  public synchronized void write(DataOutput out) throws IOException {
    out.writeDouble(getCpuTotalGHz());
    out.writeDouble(getMemTotalGB());
    out.writeInt(getNumCpu());
    out.writeInt(getNumRunningJobs());
    out.writeInt(getNumTaskTrackers());
    out.writeDouble(getMemUsageGB());
    out.writeDouble(getCpuUsageGHz());
  }
633171
private void writeObject(final ObjectOutputStream out)
		throws IOException
	{
		out.defaultWriteObject();

		out.writeInt(_length);
		out.writeDouble(_p);
		out.writeInt(_genes.length);
		out.write(_genes);
	}
1360962
private void writeObject(final ObjectOutputStream out) throws IOException {
		// write all the non-transient fields
		out.defaultWriteObject();

		// write the non-serializable default value field
		if (defaultValue == null) {
			// we don't have a default value
			out.writeBoolean(false);
		} else {
			// we have a default value
			out.writeBoolean(true);

			byte[] serializedDefaultValue;
			try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
					DataOutputViewStreamWrapper outView = new DataOutputViewStreamWrapper(baos)) {

				TypeSerializer<T> duplicateSerializer = serializer.duplicate();
				duplicateSerializer.serialize(defaultValue, outView);

				outView.flush();
				serializedDefaultValue = baos.toByteArray();
			}
			catch (Exception e) {
				throw new IOException("Unable to serialize default value of type " +
						defaultValue.getClass().getSimpleName() + ".", e);
			}

			out.writeInt(serializedDefaultValue.length);
			out.write(serializedDefaultValue);
		}
	}
67238
private void writeObject(java.io.ObjectOutputStream out)
                    throws IOException
    {
        out.defaultWriteObject();
        // write out the header information
        out.write(eyecatcher);
        out.writeShort(platform);
        out.writeShort(versionID);

        // write out the data
        out.writeObject(server);
        out.writeObject(allWrappers);
        out.writeInt(chunkSize);
    }
197175
public void writeObject (ObjectOutputStream out)
        throws IOException
    {
        int ecount = size();
        out.writeInt(ecount);
        for (int ii = 0; ii < ecount; ii++) {
            out.writeObject(get(ii));
        }
    }
929183
private void writeObject(final ObjectOutputStream out) throws IOException {
        out.defaultWriteObject();
        out.writeInt(table.length);

        // Have to use null-terminated list because size might shrink
        // during iteration

        for (final Object o : entrySet()) {
            final Map.Entry entry = (Map.Entry) o;
            out.writeObject(entry.getKey());
            out.writeObject(entry.getValue());
        }
        out.writeObject(null);
    }
293498
private void writeObject(ObjectOutputStream stream) throws IOException {
		final Object[] lList = this.listeners;
		stream.defaultWriteObject();

		// Save the non-null event listeners:
		for (int i = 0; i < lList.length; i += 2) {
			final Class<?> t = (Class<?>) lList[i];
			final EventListener l = (EventListener) lList[i + 1];
			if ((l != null) && (l instanceof Serializable)) {
				stream.writeObject(t.getName());
				stream.writeObject(l);
			}
		}

		stream.writeObject(null);
	}
188373
private void writeObject(ObjectOutputStream s) throws IOException {
        ObjectOutputStream.PutField putField = s.putFields();
        putField.put("version", version);
        putField.put("resourceAdapterKey", resourceAdapterKey);
        s.writeFields();
    }
1073864
public void writeObject(java.io.DataOutputStream dataOutputStream)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, "writeObject"
                        , "dataOutputStream=" + dataOutputStream);

        try
        {
            dataOutputStream.writeByte(SimpleSerialVersion);
            dataOutputStream.writeLong(identifier);
            if (XID == null)
            {
                dataOutputStream.writeByte(0);
            }
            else
            { // Non null XID.
                dataOutputStream.writeByte(XID.length);
                dataOutputStream.write(XID);
            } // if (XID == null).

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

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

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, "writeObject");
    }
986147
@Override
  public void write(DataOutput out) throws IOException {
    Text.writeString(out, getJobId());
    out.writeDouble(getCpuUsageGHz());
    out.writeDouble(getMemUsageGB());
  }
247341
public void writeObject(@NonNull ObjectOutputStream stream) throws IOException {
        stream.writeObject(id);
        stream.writeLong(createdTime);
        stream.writeLong(lastAccessedTime);
        stream.writeInt(maxInactiveInterval);
        stream.writeBoolean(isNew);
        stream.writeBoolean(isValid);
        stream.writeInt(mAttributes.size());
        String keys[] = mAttributes.keySet().toArray(EMPTY_ARRAY);
        for (String key : keys) {
            Object value = mAttributes.get(key);
            if (value != null && value instanceof Serializable) {
                stream.writeObject(key);
                stream.writeObject(value);
            }
        }
    }
1135595
private void writeObject(java.io.ObjectOutputStream out)
                    throws IOException
    {
        out.defaultWriteObject();
        out.write(frciEyecatcher);
        out.writeShort(frciPlatform);
        out.writeShort(frciVersionID);
    }
1201535
private void writeObject(ObjectOutputStream out) throws IOException {
		super.write(out);
		out.writeUTF(this.mapreduceInputFormat.getClass().getName());
		out.writeUTF(this.keyClass.getName());
		out.writeUTF(this.valueClass.getName());
		this.configuration.write(out);
	}
126328
@Override
    public void write(DataOutput out) throws IOException {
        out.writeInt(contentType.ordinal());
        if (content != null) {
            WritableUtils.writeVInt(out, content.length);
            out.write(content, 0, content.length);
        } else if (is != null) {
            content = new byte[MAX_BUFFER_SIZE];
            int len = 0;
            while ((len = is.read(content)) > 0) {
                out.write(content, 0, len);
            }
        }      
    }
919786
private void write(final DataInputStream stream, final Writer outputWriter, final int numberOfBytes)
      throws IOException {
    final byte[] buf = new byte[65535];
    int lenRemaining = numberOfBytes;
    while (lenRemaining > 0) {
      final int len = stream.read(buf, 0, lenRemaining > 65535 ? 65535 : lenRemaining);
      if (len > 0) {
        outputWriter.write(new String(buf, 0, len, "UTF-8"));
        lenRemaining -= len;
      } else {
        break;
      }
    }
  }
504753
private Serializer write(Object object) throws IOException {
        if (null == object) return writeNull();
        if (object instanceof Number) return writeNumber((Number) object);
        if (object instanceof String) return writeString((String) object);
        if (object instanceof Boolean) return writeBoolean((Boolean) object);
        if (object instanceof JSONObject) return writeObject((JSONObject) object);
        if (object instanceof JSONArray) return writeArray((JSONArray) object);

        throw new IOException("Attempting to serialize unserializable object: '" + object + "'");
    }