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.intermine.common.swing.table.GenericTableModel.java

/**
 * Deserialisation method. Recreates a logger and tries to deserialise the rows.
 * //from  w  w w.  j a va 2  s.  c  om
 * @param in The ObjectInputStream doing the reading.
 * 
 * @throws ClassNotFoundException if the class of a deserialised object cannot
 * be found. 
 * @throws IOException if there is a problem reading from the stream.
 * 
 * @serialData Recreates the transient logger after deserialisation, and reads the
 * rows of the model if any were written out.
 */
private void readObject(ObjectInputStream in) throws ClassNotFoundException, IOException {
    logger = LogFactory.getLog(getClass());
    in.defaultReadObject();

    @SuppressWarnings("unchecked")
    ArrayList<T> fetched = (ArrayList) in.readObject();
    if (fetched == null) {
        rows = new ArrayList<T>();
    } else {
        rows = fetched;
    }
}

From source file:org.grouplens.grapht.graph.DAGNode.java

/**
 * Override the object reading protocol to make sure caches are instantiated.  This just calls
 * {@link #initializeCaches()} after doing the default object-reading.
 *
 * @param stream The stream to read from.
 * @throws IOException If an I/O exception occurs deserializing the object.
 * @throws ClassNotFoundException If there is a missing class deserializing the object.
 */// ww w  .  ja v  a2s  .c  om
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
    stream.defaultReadObject();
    initializeCaches();
}

From source file:com.elsevier.spark_xml_utils.xpath.XPathProcessor.java

/**
 * Restore the serialized object and then do a one time initialization to improve
 * performance for repetitive invocations of filter and evaluate expressions.  We need to
 * initialize the transient variables.//from w w w  . j  ava  2  s  .co  m
 * 
 * @param inputStream
 * @throws IOException
 * @throws ClassNotFoundException
 * @throws XPathException 
 */
private void readObject(ObjectInputStream inputStream)
        throws IOException, ClassNotFoundException, XPathException {

    inputStream.defaultReadObject();
    init();

}

From source file:cat.albirar.framework.dynabean.impl.DynaBeanDescriptor.java

/**
 * On deserialize, reconstruct the implemented type information.
 * @param in The io input stream to read from
 * @throws IOException If errors on reading from io stream
 * @throws ClassNotFoundException If any deserialized class is not found on loader
 *///  w  w  w  . j  a  v a  2s. c  om
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    resolveAfterDeserialization();
}

From source file:edu.cmu.tetrad.util.TetradMatrix.java

/**
 * Adds semantic checks to the default deserialization method. This method
 * must have the standard signature for a readObject method, and the body of
 * the method must begin with "s.defaultReadObject();". Other than that, any
 * semantic checks can be specified and do not need to stay the same from
 * version to version. A readObject method of this form may be added to any
 * class, even if Tetrad sessions were previously saved out using a version
 * of the class that didn't include it. (That's what the
 * "s.defaultReadObject();" is for. See J. Bloch, Effective Java, for help.
 *
 * @throws java.io.IOException/*from  ww w.j  av  a  2  s.  co m*/
 * @throws ClassNotFoundException
 */
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
    s.defaultReadObject();

    if (m == 0)
        m = apacheData.getRowDimension();
    if (n == 0)
        n = apacheData.getColumnDimension();
}

From source file:net.sourceforge.vulcan.web.struts.forms.PluginConfigForm.java

private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
    stream.defaultReadObject();
    propertyDescriptors = new ArrayList<PropertyDescriptor>();
}

From source file:net.lightbody.bmp.proxy.jetty.http.ResourceCache.java

private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    _cache = new HashMap();
}

From source file:org.apache.flink.configuration.Configuration.java

private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
    s.defaultReadObject();
    this.classLoader = getClass().getClassLoader();
}

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

private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    if (getClass() == NamespaceImpl.class) {
        in.defaultReadObject();
        _needDeserialize = true;/*from   w  w w.ja v a 2 s.  co m*/
    }
}

From source file:pt.quintans.ezSQL.toolkit.io.BinStore.java

/**
 * Reads the state of this object during deserialization.
 * //www  .ja  v a2s  .  c o  m
 * @param in
 *            The stream from which the state should be read.
 * 
 * @throws IOException
 *             if an error occurs.
 * @throws ClassNotFoundException
 *             if class cannot be found.
 */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    // read values
    in.defaultReadObject();

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

    this.cachedContent = null;
}