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.nd4j.linalg.jcublas.buffer.BaseCudaDataBuffer.java

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

}

From source file:org.springframework.messaging.MessageHeaders.java

private void writeObject(ObjectOutputStream out) throws IOException {
    Set<String> keysToIgnore = new HashSet<>();
    this.headers.forEach((key, value) -> {
        if (!(value instanceof Serializable)) {
            keysToIgnore.add(key);//from   w  ww  . j  a v  a 2s .c  o m
        }
    });

    if (keysToIgnore.isEmpty()) {
        // All entries are serializable -> serialize the regular MessageHeaders instance
        out.defaultWriteObject();
    } else {
        // Some non-serializable entries -> serialize a temporary MessageHeaders copy
        if (logger.isDebugEnabled()) {
            logger.debug("Ignoring non-serializable message headers: " + keysToIgnore);
        }
        out.writeObject(new MessageHeaders(this, keysToIgnore));
    }
}

From source file:org.kuali.rice.krms.impl.repository.RuleBo.java

private void writeObject(ObjectOutputStream stream) throws IOException, ClassNotFoundException {
    if (proposition != null) {
        proposition.getId();//w ww. ja  v  a  2  s . co m
    }
    stream.defaultWriteObject();
}

From source file:com.cyberway.issue.crawler.datamodel.CandidateURI.java

/**
 * Custom serialization writing 'uuri' and 'via' as Strings, rather
 * than the bloated full serialization of their object classes, and 
 * an empty alist as 'null'. Shrinks serialized form by 50% or more
 * in short tests. //from w w w .j a v  a2 s  . co m
 * 
 * @param stream
 * @throws IOException
 */
private void writeObject(ObjectOutputStream stream) throws IOException {
    stream.defaultWriteObject();
    stream.writeUTF(uuri.toString());
    stream.writeObject((via == null) ? null : via.getURI());
    stream.writeObject((alist == null) ? null : alist);
}

From source file:org.ajax4jsf.webapp.CacheContent.java

private void writeObject(java.io.ObjectOutputStream s) throws IOException {
    if (filledOutputStream) {
        if (outputStream != null) {
            content = outputStream.toByteArray();
        }//from w w w.jav a  2s. c om
    } else if (filledOutputWriter) {
        if (stringOutputWriter != null) {
            char[] cs = stringOutputWriter.toCharArray();
            writerContent = new String(cs);
        }
    }
    s.defaultWriteObject();
}

From source file:org.archive.bdb.BdbModule.java

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

From source file:com.stromberglabs.jopensurf.Surf.java

private void writeObject(ObjectOutputStream out) throws IOException {
    if (mFreeOrientedPoints == null) {
        getFreeOrientedInterestPoints();
    }//from  w  ww  . j av  a2  s  .  co m
    if (mUprightPoints == null) {
        getUprightInterestPoints();
    }
    out.defaultWriteObject();
}

From source file:bin.spider.frame.uri.CandidateURI.java

/**
 * Custom serialization writing 'uuri' and 'via' as Strings, rather
 * than the bloated full serialization of their object classes, and 
 * an empty alist as 'null'. Shrinks serialized form by 50% or more
 * in short tests. /*from w w w.j av  a2 s . co m*/
 * 
 * @param stream
 * @throws IOException
 * @throws URIException 
 */
private void writeObject(ObjectOutputStream stream) throws IOException, URIException {
    stream.defaultWriteObject();
    stream.writeUTF(uuri.toString());
    stream.writeObject((via == null) ? null : via.getURI());
    stream.writeObject((alist == null) ? null : alist);
}

From source file:com.zc.study.fileinjection.springintegration.MessageHeaders.java

private void writeObject(ObjectOutputStream out) throws IOException {
    Set<String> keysToIgnore = new HashSet<String>();
    for (Map.Entry<String, Object> entry : this.headers.entrySet()) {
        if (!(entry.getValue() instanceof Serializable)) {
            keysToIgnore.add(entry.getKey());
        }//from  w ww.  ja  v a2 s . c  o  m
    }

    if (keysToIgnore.isEmpty()) {
        // All entries are serializable -> serialize the regular MessageHeaders instance
        out.defaultWriteObject();
    } else {
        // Some non-serializable entries -> serialize a temporary MessageHeaders copy
        if (logger.isDebugEnabled()) {
            logger.debug("Ignoring non-serializable message headers: " + keysToIgnore);
        }
        out.writeObject(new MessageHeaders(this, keysToIgnore));
    }
}

From source file:org.kitesdk.data.spi.Constraints.java

/**
 * Writes out the {@link Constraints} using Java serialization.
 *///from   ww w  .ja  v a2 s . co m
private void writeObject(java.io.ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();
    out.writeUTF(schema.toString());
    out.writeUTF(strategy != null ? strategy.toString() : "");
    ConstraintsSerialization.writeConstraints(schema, strategy, constraints, out);
}