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.projity.pm.resource.EnterpriseResource.java

private void writeObject(ObjectOutputStream s) throws IOException {
    s.defaultWriteObject();
    hasKey.serialize(s);//from  w w  w  . ja v a  2s.c  o  m
    costRateTables.serialize(s);
    customFields.serialize(s);
    s.writeInt(hasAssignments.getSchedulingType());
    s.writeBoolean(hasAssignments.isEffortDriven());
    availabilityTable.serialize(s);
}

From source file:ConcurrentWeakHashMap.java

/**
 * Save the state of the <tt>ConcurrentWeakHashMap</tt> instance to a
 * stream (i.e., serialize it).//  w w  w .  ja v a  2  s.co  m
 * @param s the stream
 * @serialData
 * the key (Object) and value (Object)
 * for each key-value mapping, followed by a null pair.
 * The key-value mappings are emitted in no particular order.
 */
private void writeObject(java.io.ObjectOutputStream s) throws IOException {
    s.defaultWriteObject();

    for (int k = 0; k < segments.length; ++k) {
        Segment<K, V> seg = segments[k];
        seg.lock();
        try {
            HashEntry<K, V>[] tab = seg.table;
            for (int i = 0; i < tab.length; ++i) {
                for (HashEntry<K, V> e = tab[i]; e != null; e = e.next) {
                    K key = e.keyRef.get();
                    if (key == null) // Skip GC'd keys
                        continue;

                    s.writeObject(key);
                    s.writeObject(e.value);
                }
            }
        } finally {
            seg.unlock();
        }
    }
    s.writeObject(null);
    s.writeObject(null);
}

From source file:net.sf.maltcms.chromaui.charts.FastHeatMapPlot.java

/**
 * Provides serialization support./*from   www.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(ObjectOutputStream stream) throws IOException {
    stream.defaultWriteObject();
    SerialUtilities.writePaint(this.paint, stream);
    SerialUtilities.writeStroke(this.domainGridlineStroke, stream);
    SerialUtilities.writePaint(this.domainGridlinePaint, stream);
    SerialUtilities.writeStroke(this.rangeGridlineStroke, stream);
    SerialUtilities.writePaint(this.rangeGridlinePaint, stream);
    stream.writeObject(ImageIO.write(this.dataImage, "PNG", stream));
    stream.flush();
}

From source file:com.meidusa.amoeba.net.poolable.copy.CursorableLinkedList.java

private void writeObject(ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();
    out.writeInt(_size);//w w w .  j  a  v  a2 s .  c o m
    Listable cur = _head.next();
    while (cur != null) {
        out.writeObject(cur.value());
        cur = cur.next();
    }
}

From source file:er.directtoweb.pages.ERD2WPage.java

private void writeObject(ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();
    out.writeObject(d2wContext().valueForKey(Keys.tabKey));
    out.writeObject(d2wContext().valueForKey(Keys.tabCount));
    out.writeObject(d2wContext().valueForKey(Keys.tabIndex));
}

From source file:edu.umd.cs.marmoset.modelClasses.TestOutcome.java

private void writeObject(ObjectOutputStream stream) throws IOException {
    truncateLongTestResult();//from   w  w  w .  ja v  a2  s  .  c  om
    stream.writeInt(serialMinorVersion);
    stream.defaultWriteObject();
}

From source file:com.cyberway.issue.crawler.fetcher.FetchHTTP.java

private void writeObject(ObjectOutputStream stream) throws IOException {
    stream.defaultWriteObject();
    // save cookies
    @SuppressWarnings("unchecked")
    Collection<Cookie> c = http.getState().getCookiesMap().values();
    Cookie[] cookies = c.toArray(new Cookie[c.size()]);
    stream.writeObject(cookies);/*from w  ww.  j  a  v  a2 s  . c  o m*/
}

From source file:org.archive.crawler.fetcher.OptimizeFetchHTTP.java

private void writeObject(ObjectOutputStream stream) throws IOException {
    stream.defaultWriteObject();
    // save cookies
    HttpClient http = this.getClient();
    @SuppressWarnings("unchecked")
    Collection<Cookie> c = http.getState().getCookiesMap().values();
    Cookie[] cookies = c.toArray(new Cookie[c.size()]);
    stream.writeObject(cookies);//w w w .  j  a  v a 2  s.com
}

From source file:genlab.gui.jfreechart.EnhancedSpiderWebPlot.java

/**
 * Provides serialization support.//w  ww  .  jav a 2s.c  o  m
 *
 * @param stream  the output stream.
 *
 * @throws IOException  if there is an I/O error.
 */
private void writeObject(ObjectOutputStream stream) throws IOException {
    stream.defaultWriteObject();

    SerialUtilities.writeShape(this.legendItemShape, stream);
    SerialUtilities.writePaint(this.seriesPaint, stream);
    SerialUtilities.writePaint(this.baseSeriesPaint, stream);
    SerialUtilities.writePaint(this.seriesOutlinePaint, stream);
    SerialUtilities.writePaint(this.baseSeriesOutlinePaint, stream);
    SerialUtilities.writeStroke(this.seriesOutlineStroke, stream);
    SerialUtilities.writeStroke(this.baseSeriesOutlineStroke, stream);
    SerialUtilities.writePaint(this.labelPaint, stream);
    SerialUtilities.writePaint(this.axisLinePaint, stream);
    SerialUtilities.writeStroke(this.axisLineStroke, stream);
}

From source file:de.laures.cewolf.jfree.ThermometerPlot.java

/**
 * Provides serialization support.//from w  w  w .ja va2  s  .c  om
 *
 * @param stream  the output stream.
 *
 * @throws IOException  if there is an I/O error.
 */
private void writeObject(ObjectOutputStream stream) throws IOException {
    stream.defaultWriteObject();
    SerialUtilities.writeStroke(this.thermometerStroke, stream);
    SerialUtilities.writePaint(this.thermometerPaint, stream);
    SerialUtilities.writePaint(this.valuePaint, stream);
    SerialUtilities.writePaint(this.mercuryPaint, stream);
    SerialUtilities.writeStroke(this.subrangeIndicatorStroke, stream);
    SerialUtilities.writeStroke(this.rangeIndicatorStroke, stream);
    for (int i = 0; i < 3; i++) {
        SerialUtilities.writePaint(this.subrangePaint[i], stream);
    }
}