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.springframework.aop.framework.ProxyFactoryBean.java

private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
    // Rely on default serialization; just initialize state after deserialization.
    ois.defaultReadObject();

    // Initialize transient fields.
    this.proxyClassLoader = ClassUtils.getDefaultClassLoader();
}

From source file:gov.nih.nci.caintegrator.ui.graphing.chart.plot.BoxAndWhiskerCoinPlotRenderer.java

/**
 * Provides serialization support.//from   w  ww  .  j a  v  a2s. c om
 *
 * @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();
    setArtifactPaint(SerialUtilities.readPaint(stream));
}

From source file:au.gov.ansto.bragg.nbi.restlet.fileupload.disk.DiskFileItem.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 w  w w. ja v a 2s.  c  om
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    // read values
    in.defaultReadObject();

    /* One expected use of serialization is to migrate HTTP sessions
     * containing a DiskFileItem between JVMs. Particularly if the JVMs are
     * on different machines It is possible that the repository location is
     * not valid so validate it.
     */
    if (repository != null) {
        if (repository.isDirectory()) {
            // Check path for nulls
            if (repository.getPath().contains("\0")) {
                throw new IOException(
                        format("The repository [%s] contains a null character", repository.getPath()));
            }
        } else {
            throw new IOException(
                    format("The repository [%s] is not a directory", repository.getAbsolutePath()));
        }
    }

    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:extern.NpairsBoxAndWhiskerRenderer.java

/**
 * Provides serialization support./*from  w w  w . jav  a2  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.artifactPaint = SerialUtilities.readPaint(stream);
}

From source file:org.springframework.aop.aspectj.AspectJExpressionPointcut.java

private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
    // Rely on default serialization, just initialize state after deserialization.
    ois.defaultReadObject();

    // Initialize transient fields.
    // pointcutExpression will be initialized lazily by checkReadyToMatch()
    this.shadowMatchCache = new ConcurrentHashMap<>(32);
}

From source file:blue.components.lines.Line.java

private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
    stream.defaultReadObject();

    for (Iterator iter = points.iterator(); iter.hasNext();) {
        LinePoint lp = (LinePoint) iter.next();
        lp.addChangeListener(this);
    }/*from  w  w w .ja v a 2  s.com*/
}

From source file:ch.mlutz.plugins.t4e.tapestry.TapestryModule.java

private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
    stream.defaultReadObject();

    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    webappFolder = EclipseSerializer.deserializeResource(stream, workspaceRoot, IContainer.class);

    for (TapestryHtmlElement component : components) {
        component.setParent(this);
    }/*from  w ww  . jav  a2 s  .c  o m*/

    for (TapestryHtmlElement page : pages) {
        page.setParent(this);
    }

    setChangeListener(Activator.getDefault().getTapestryIndexer());
}

From source file:org.alfresco.web.bean.wizard.BaseInviteUsersWizard.java

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();

    this.userRolesDataModel = new ListDataModel();
    this.userRolesDataModel.setWrappedData(this.userGroupRoles);

}

From source file:org.taverna.server.master.localworker.RemoteRunDelegate.java

@SuppressWarnings("unchecked")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    if (log == null)
        log = getLog("Taverna.Server.LocalWorker");
    final String creatorName = in.readUTF();
    SecurityContextFactory factory = (SecurityContextFactory) in.readObject();
    try {//from  w ww  .j  ava 2 s  .  com
        secContext = factory.create(this, new UsernamePrincipal(creatorName));
    } catch (RuntimeException e) {
        throw e;
    } catch (IOException e) {
        throw e;
    } catch (Exception e) {
        throw new SecurityContextReconstructionException(e);
    }
    run = ((MarshalledObject<RemoteSingleRun>) in.readObject()).get();
}

From source file:HashMap.java

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    doReadObject(in);//w  w w .j a  v a 2  s.co m
}