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:alice.tuprolog.lib.OOLibrary.java

/**
 * handling readObject method is necessary in order to have the library
 * reconstructed after a serialization/*from w ww . j a v  a2s. co m*/
 */
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    currentObjects = new HashMap<>();
    currentObjects_inverse = new IdentityHashMap<>();
    preregisterObjects();
}

From source file:org.archive.modules.CrawlURI.java

private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
    stream.defaultReadObject();
    @SuppressWarnings("unchecked")
    Map<String, Object> temp = (Map<String, Object>) stream.readObject();
    this.data = temp;
    outLinks = new HashSet<Link>();
    outCandidates = new HashSet<CrawlURI>();
}

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

private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    _statsLock = new Object[0];
    getHandlers();//www.java2  s. c  o  m
    for (int i = 0; i < _handlersArray.length; i++)
        _handlersArray[i].initialize(this);
}

From source file:org.jgap.Configuration.java

/**
 * Deserialize the object. Needed to provide a unique ID for each thread the
 * object is used in.//from   w  ww .  jav  a2s. c o m
 *
 * @param a_inputStream the ObjectInputStream provided for deserialzation
 * @throws ClassNotFoundException
 * @throws IOException
 *
 * @author Klaus Meffert
 * @since 3.01
 */
private void readObject(ObjectInputStream a_inputStream) throws ClassNotFoundException, IOException {
    // Always perform the default de-serialization first.
    // --------------------------------------------------
    a_inputStream.defaultReadObject();
    makeThreadKey();
}

From source file:DateFormatUtils.java

/**
 * Create the object after serialization. This implementation reinitializes the 
 * transient properties.//  www  .jav  a2 s  . c  o m
 *
 * @param in ObjectInputStream from which the object is being deserialized.
 * @throws IOException if there is an IO issue.
 * @throws ClassNotFoundException if a class cannot be found.
 */
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    init();
}

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

private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException {
    is.defaultReadObject();
    instantiateFunc();//from  w  w  w. j a v  a  2 s.c o m
}

From source file:hudson.FilePath.java

private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
    Channel channel = Channel.current();
    assert channel != null;

    ois.defaultReadObject();
    if (ois.readBoolean()) {
        this.channel = channel;
    } else {//from w w  w . ja va 2s . c  om
        this.channel = null;
    }
}

From source file:com.gargoylesoftware.htmlunit.WebClient.java

/**
 * When we deserialize, re-initializie transient fields.
 * @param in the object input stream/* w w w . j  a v  a2 s. c  o  m*/
 * @throws IOException if an error occurs
 * @throws ClassNotFoundException if an error occurs
 */
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();

    webConnection_ = createWebConnection();
    scriptEngine_ = new JavaScriptEngine(this);
    jobManagers_ = Collections.synchronizedList(new ArrayList<WeakReference<JavaScriptJobManager>>());

    if (getBrowserVersion().hasFeature(JS_XML_SUPPORT_VIA_ACTIVEXOBJECT)) {
        initMSXMLActiveX();
    }
}

From source file:com.gargoylesoftware.htmlunit.javascript.host.Window.java

/**
 * Restores the transient {@link #computedStyles_} map during deserialization.
 * @param stream the stream to read the object from
 * @throws IOException if an IO error occurs
 * @throws ClassNotFoundException if a class is not found
 *///from  w ww . j av  a  2 s  . c  o  m
private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException {
    stream.defaultReadObject();
    computedStyles_ = new WeakHashMap<>();
}