Example usage for java.io ObjectOutputStream defaultWriteObject

List of usage examples for java.io ObjectOutputStream defaultWriteObject

Introduction

In this page you can find the example usage for java.io ObjectOutputStream defaultWriteObject.

Prototype

public void defaultWriteObject() throws IOException 

Source Link

Document

Write the non-static and non-transient fields of the current class to this stream.

Usage

From source file:org.protempa.HighLevelAbstractionDefinition.java

private void writeObject(ObjectOutputStream s) throws IOException {
    s.defaultWriteObject();
    s.writeObject(defPairsMap);
}

From source file:org.opencastproject.capture.impl.RecordingImpl.java

/**
 * Overrides the default serialization behaviour. This method writes the mediapackage to the mediapackage.xml file in
 * the base directory of this capture/*from   w w  w .  j  av a  2  s.c o m*/
 * 
 * @param out
 *          The ObjectOutputStream for the serialization
 * @throws IOException
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();
    try {
        MediaPackageParser.getAsXml(mPkg, out, true);
    } catch (MediaPackageException e) {
        logger.error("Unable to write mediapackage to disk!  Error was: {}.", e);
    }
}

From source file:net.sf.nmedit.jtheme.store2.AbstractMultiParameterElement.java

private void writeObject(java.io.ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();

    out.writeInt(parameterElementNames.length);

    int size = 0;
    for (int i = 0; i < parameterElementNames.length; i++) {
        String n = parameterElementNames[i];
        if (n != null)
            size++;//w  w w  . j  a  v a 2 s. co m
    }

    out.writeInt(size);
    for (int i = 0; i < parameterElementNames.length; i++) {
        String n = parameterElementNames[i];
        if (n != null) {
            out.writeInt(i);
            out.writeObject(n);
        }
    }

    size = 0;
    for (int i = 0; i < componentIdList.length; i++) {
        String n = componentIdList[i];
        if (n != null)
            size++;
    }

    out.writeInt(size);
    for (int i = 0; i < componentIdList.length; i++) {
        String n = componentIdList[i];
        if (n != null) {
            out.writeInt(i);
            out.writeObject(n);
        }
    }

    size = 0;
    if (valueList != null) {
        for (int i = 1; i < valueList.length; i += 2) {
            if (valueList[i] != null)
                size++;
        }
    }
    out.writeInt(size);
    if (valueList != null) {
        for (int i = 0; i < valueList.length; i += 2) {
            String n = (String) valueList[i];
            Integer v = (Integer) valueList[i + 1];
            if (v != null) {
                out.writeObject(n);
                out.writeInt(v.intValue());
            }
        }
    }
}

From source file:org.grouplens.samantha.modeler.space.SynchronizedVariableSpace.java

private void writeObject(ObjectOutputStream stream) {
    readLock.lock();/*from  w  w w .  jav  a 2  s  .  c om*/
    try {
        stream.defaultWriteObject();
    } catch (IOException e) {
        throw new BadRequestException(e);
    } finally {
        readLock.unlock();
    }
}

From source file:org.mule.session.DefaultMuleSession.java

private void writeObject(ObjectOutputStream out) throws IOException {
    DefaultMuleSession copy = new DefaultMuleSession(this);
    copy.removeNonSerializableProperties();
    out.defaultWriteObject();
    out.writeObject(copy.properties);/*  w w  w  .jav  a  2s  .com*/
}

From source file:org.pentaho.plugin.jfreereport.reportcharts.backport.XYDotRenderer.java

/**
 * Provides serialization support./*w  w w .j  a  v a  2 s .  c o m*/
 *
 * @param stream the output stream.
 * @throws IOException if there is an I/O error.
 */
private void writeObject(final ObjectOutputStream stream) throws IOException {
    stream.defaultWriteObject();
    SerialUtilities.writeShape(this.legendShape, stream);
}

From source file:org.seasar.mayaa.impl.engine.processor.TemplateProcessorSupport.java

private void writeObject(ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();
    String originalNodeID = NodeSerializeController.makeKey(_originalNode);
    String uniqueID = getUniqueID();
    out.writeUTF(originalNodeID);//w  w w .  ja  v  a2  s. c om
    out.writeUTF(uniqueID);
    out.writeUTF(_injectedNode.getQName().getNamespaceURI().getValue());
    out.writeUTF(_injectedNode.getQName().getLocalName());

    NodeSerializeController controller = SpecificationImpl.nodeSerializer();
    if (controller.collectNode(_injectedNode)) {
        // ??
        out.writeUTF(UNIQUENESS_MARK);
        out.writeObject(_injectedNode);
    } else {
        // ???
        out.writeUTF(NodeSerializeController.makeKey(_injectedNode));
    }
    /*
    if (_injectedNode.getParentNode() != null && !(getParentProcessor() instanceof Template)) {
    String injectedNodeID = NodeSerializeController.makeKey(_injectedNode);
    out.writeUTF(injectedNodeID);
    } else {
    out.writeUTF(DUPLICATE_ROOT_MARK);
    out.writeObject(_injectedNode);
    }
      */
}

From source file:org.plasma.sdo.core.CoreSetting.java

/**
 * Writes out metadata logical names as string
 * for serialization./*from   w w w  .j  av a 2 s.  co  m*/
 * @param out the stream
 * @throws IOException
 */
private void writeObject(java.io.ObjectOutputStream out) throws IOException {
    this.propertyName = this.property.getName();
    this.propertyTypeName = this.property.getContainingType().getName();
    this.propertyTypeUri = this.property.getContainingType().getURI();
    this.property = null;
    out.defaultWriteObject();
}

From source file:ddf.catalog.data.AttributeImpl.java

/**
 * Serializes this {@link AttributeImpl} instance.
 * //from w w  w .j  av a  2 s.c om
 * @serialData First, all non-transient fields are written out by the
 *             default Java serialization implementation
 *             (ObjectInputStream.defaultWriteObject()). Then the number of
 *             "value" objects is written out as an ({@code int}). After the
 *             number of objects, each "value" object is written out (each
 *             as {@code Serializable}).
 * @param s
 *            - the {@link ObjectOutputStream} which contains the object to
 *            be serialized
 * @throws IOException
 */
private void writeObject(ObjectOutputStream s) throws IOException {

    /*
     * defaultWriteObject() is invoked for greater flexibility and
     * compatibility. See the *Serialization Note* in MetacardImpl's class
     * Javadoc.
     */
    s.defaultWriteObject();

    s.writeInt(values.size());

    for (Serializable ser : values) {
        s.writeObject(ser);
    }
}

From source file:org.seasar.mayaa.impl.engine.specification.SpecificationNodeImpl.java

private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    out.defaultWriteObject();
    // namespace/*from   ww w  .  j  a  v a2s .co  m*/
    out.writeUTF(super.toString());
    if (getParentSpace() != null && getParentSpace().getClass() == NamespaceImpl.class) {
        out.writeObject(getParentSpace());
    } else {
        out.writeObject(new Serializable() {
            private static final long serialVersionUID = 1L;
        });
    }
}