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:com.doculibre.constellio.wicket.models.ReloadableEntityModel.java

private void writeObject(ObjectOutputStream oos) throws IOException {
    prepareForSerialization();
    oos.defaultWriteObject();
}

From source file:edu.cuny.jfree.chart.renderer.category.ValueListShapeRenderer.java

private void writeObject(final ObjectOutputStream stream) throws IOException {
    stream.defaultWriteObject();
}

From source file:com.github.gfernandez598.swf.conversation.optforrepl.ContainedConversation.java

/**
 * Serialization to handle the transient object(s)
 * /*from w ww.j  ava 2 s  .  c  o m*/
 * @param out
 *            the output stream
 * @throws IOException
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();
}

From source file:org.mule.message.ExceptionMessage.java

private void writeObject(ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();
    try {//from   w ww . ja  va2s . c o  m
        out.writeObject(exception);
    } catch (NotSerializableException e) {
        logger.warn("Exception " + exception.getClass().getName()
                + " is not serializable and will be lost when sending ExceptionMessage over the wire: "
                + e.getMessage());
    }
    try {
        out.writeObject(payload);
    } catch (NotSerializableException e) {
        logger.warn("Payload " + payload.getClass().getName()
                + " is not serializable and will be lost when sending ExceptionMessage over the wire: "
                + e.getMessage());
    }
}

From source file:org.jactr.tools.async.message.ast.BaseASTMessage.java

private void writeObject(java.io.ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();
    if (_ast != null) {
        out.writeBoolean(true);//from ww w. j  a v  a 2  s.  c  o  m
        out.writeBoolean(_compress);

        if (_compress) {
            /*
             * go to a GZIPOutputStream
             */
            ByteArrayOutputStream baos = _localBAOS.get();
            if (baos == null) {
                baos = new ByteArrayOutputStream();
                _localBAOS.set(baos);
            }
            baos.reset();

            DataOutputStream zip = new DataOutputStream(new GZIPOutputStream(baos));
            Serializer.write(_ast, zip);
            zip.flush();
            zip.close();
            // byte[] bytes = baos.toByteArray();

            if (LOGGER.isDebugEnabled())
                LOGGER.debug(String.format("Writing %d compressed bytes", baos.size()));

            out.writeInt(baos.size());
            baos.writeTo(out);

            // if (LOGGER.isDebugEnabled())
            // LOGGER.debug("Compressed AST to "+bytes.length);
            // out.writeInt(bytes.length);
            // out.write(bytes);
        } else
            Serializer.write(_ast, out);
    } else
        out.writeBoolean(false);
}

From source file:com.abelsky.idea.geekandpoke.entries.Entry.java

private void writeObject(@NotNull ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();
    if (imageRef != null) {
        @Nullable/* www.  j av  a 2  s .c o  m*/
        BufferedImage image = imageRef.get();
        if (image == null) {
            image = fetchCachedImage();
            imageRef = new SoftReference<BufferedImage>(image);
        }
        ImageIO.write(image, "png", ImageIO.createImageOutputStream(out));
    }
}

From source file:org.nuclos.common.collect.collectable.searchcondition.CollectableComparison.java

private void writeObject(ObjectOutputStream oos) throws IOException {
    oos.defaultWriteObject();

    // CollectableField is generally not serializable, CollectableValue[Id]Field is:
    final CollectableField clctf;
    if (this.getComparand().isIdField()
            && !NuclosEOField.isEOFieldWithForceValueSearch(this.getEntityField().getName())) {
        clctf = new CollectableValueIdField(this.getComparand().getValueId(), this.getComparand().getValue());
    } else {// w w w.  j  av a 2  s .  c om
        clctf = new CollectableValueField(this.getComparand().getValue());
    }
    oos.writeObject(clctf);
}

From source file:dk.netarkivet.common.utils.batch.ChecksumJob.java

/**
 * Invoke default method for serializing object.
 * @param s the OutputStream//from w w  w. j av  a2 s  .  co  m
 * @throws IOFailure If an exception is caught during writing of the object.
 */
private void writeObject(ObjectOutputStream s) throws IOFailure {
    try {
        s.defaultWriteObject();
    } catch (Exception e) {
        throw new IOFailure("Unexpected error during serialization", e);
    }
}

From source file:org.pentaho.reporting.libraries.designtime.swing.SerializedObjectContainer.java

private void writeObject(final ObjectOutputStream stream) throws IOException {
    stream.defaultWriteObject();
    final int count = data.length;
    stream.writeObject(data.getClass().getComponentType());
    stream.writeInt(count);//www. j  av  a  2  s. co  m
    for (int i = 0; i < count; i++) {
        final Object object = data[i];
        if (object != null && object instanceof Serializable) {
            stream.writeInt(i);
            stream.writeObject(object);
        } else {
            stream.writeInt(-1);
        }
    }
}

From source file:org.apache.hc.client5.http.impl.auth.BasicScheme.java

private void writeObject(final ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();
    out.writeUTF(this.charset.name());
}