Example usage for java.io ObjectInputStream defaultReadObject

List of usage examples for java.io ObjectInputStream defaultReadObject

Introduction

In this page you can find the example usage for java.io ObjectInputStream defaultReadObject.

Prototype

public void defaultReadObject() throws IOException, ClassNotFoundException 

Source Link

Document

Read the non-static and non-transient fields of the current class from this stream.

Usage

From source file:org.jfree.experimental.chart.plot.dial.DialValueIndicator.java

/**
 * Provides serialization support./*from   ww w.j  a va2  s  .  c  o  m*/
 *
 * @param stream  the input stream.
 *
 * @throws IOException  if there is an I/O error.
 * @throws ClassNotFoundException  if there is a classpath problem.
 */
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
    stream.defaultReadObject();
    this.paint = SerialUtilities.readPaint(stream);
    this.backgroundPaint = SerialUtilities.readPaint(stream);
    this.outlinePaint = SerialUtilities.readPaint(stream);
    this.outlineStroke = SerialUtilities.readStroke(stream);
}

From source file:org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POUserFunc.java

private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException {
    is.defaultReadObject();
    instantiateFunc(funcSpec);//from  w  w w  .j  ava 2 s.  c  om
}

From source file:org.pentaho.reporting.engine.classic.core.function.AbstractElementFormatFunction.java

/**
 * Helper method for serialization.//  w  ww .  j  a v a 2 s.c om
 *
 * @param in
 *          the input stream from where to read the serialized object.
 * @throws java.io.IOException
 *           when reading the stream fails.
 * @throws ClassNotFoundException
 *           if a class definition for a serialized object could not be found.
 */
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    attrName = computeUniqueIdentifier();
}

From source file:org.apache.cayenne.map.EntityResolver.java

/**
 * Java default deserialization seems not to invoke constructor by default -
 * invoking it manually//from  www .  j a  va 2  s. co m
 */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    refreshMappingCache();
}

From source file:org.jfree.experimental.chart.plot.dial.DialPlot.java

/**
 * Provides serialization support.//from   w  w  w .  java 2s .  c o  m
 *
 * @param stream  the input stream.
 *
 * @throws IOException  if there is an I/O error.
 * @throws ClassNotFoundException  if there is a classpath problem.
 */
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
    stream.defaultReadObject();
}

From source file:org.eclipse.emf.teneo.mapping.elist.PersistableEList.java

/** Takes care of deserializing the efeature */
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    estructuralFeature = StoreUtil.stringToStructureFeature(eFeaturePath);
}

From source file:org.cyberoam.iview.utility.MultiHashMap.java

/**
 * Read the object during deserialization.
 *//*  w  w w. ja v a2s  . c o  m*/
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
    // This method is needed because the 1.2/1.3 Java deserialisation called
    // put and thus messed up that method

    // default read object
    s.defaultReadObject();

    // problem only with jvm <1.4
    String version = "1.2";
    try {
        version = System.getProperty("java.version");
    } catch (SecurityException ex) {
        // ignore and treat as 1.2/1.3
    }

    if (version.startsWith("1.2") || version.startsWith("1.3")) {
        for (Iterator iterator = entrySet().iterator(); iterator.hasNext();) {
            Map.Entry entry = (Map.Entry) iterator.next();
            // put has created a extra collection level, remove it
            super.put(entry.getKey(), ((Collection) entry.getValue()).iterator().next());
        }
    }
}

From source file:com.alibaba.citrus.service.upload.impl.cfu.AbstractFileItem.java

/**
 * Reads the state of this object during deserialization.
 *
 * @param in The stream from which the state should be read.
 * @throws IOException            if an error occurs.
 * @throws ClassNotFoundException if class cannot be found.
 *//*from ww w  . j av a 2  s .co m*/
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    // read values
    in.defaultReadObject();

    OutputStream output = getOutputStream();
    if (cachedContent != null) {
        output.write(cachedContent);
    } else {
        FileInputStream input = new FileInputStream(dfosFile);
        IOUtils.copy(input, output);
        dfosFile.delete();
        dfosFile = null;
    }
    output.close();

    cachedContent = null;
}

From source file:org.pentaho.reporting.engine.classic.core.modules.misc.datafactory.DataFactoryScriptingSupport.java

private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException {
    stream.defaultReadObject();
    contextsByQuery = new HashMap<String, QueryScriptContext>();
}