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:ArrayDeque.java

/**
 * Deserialize this deque.//from   w  ww .j  a v a  2  s  .  co m
 */
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
    s.defaultReadObject();

    // Read in size and allocate array
    int size = s.readInt();
    allocateElements(size);
    head = 0;
    tail = size;

    // Read in all elements in the proper order.
    for (int i = 0; i < size; i++)
        elements[i] = (E) s.readObject();

}

From source file:org.alfresco.web.bean.rules.CreateRuleWizard.java

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

    this.allConditionsDataModel = new ListDataModel();
    this.allConditionsDataModel.setWrappedData(this.allConditionsPropertiesList);
}

From source file:IntHashMap.java

/**
 * Reconstitute the <tt>IntHashMap</tt> instance from a stream (i.e.,
 * deserialize it).//w ww .j  a  v  a 2s  .c o m
 */
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
    // Read in the threshold, loadfactor, and any hidden stuff
    s.defaultReadObject();

    // Read in number of buckets and allocate the bucket array;
    int numBuckets = s.readInt();
    table = new Entry[numBuckets];

    // Read in size (number of Mappings)
    int size = s.readInt();

    // Read the keys and values, and put the mappings in the IntHashMap
    for (int i = 0; i < size; i++) {
        int key = s.readInt();
        V value = (V) s.readObject();
        put(key, value);
    }
}

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

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    NSNotificationCenter.defaultCenter().addObserver(this,
            new NSSelector<Void>("editingContextDidSaveChanges", ERXConstant.NotificationClassArray),
            EOEditingContext.EditingContextDidSaveChangesNotification, null);
}

From source file:com.application.utils.FastDateParser.java

/**
 * Create the object after serialization. This implementation reinitializes the
 * transient properties./*w w  w .  j a  v  a 2  s. com*/
 *
 * @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(final ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();

    final Calendar definingCalendar = Calendar.getInstance(timeZone, locale);
    init(definingCalendar);
}

From source file:org.jabsorb.ng.JSONSerializer.java

/**
 * Reads an object, serialising each This is used by the java serialization
 * logic.//from   ww  w .j a v a 2 s .co  m
 *
 * @param in
 *            The stream to take an object to serialise
 * @throws java.io.IOException
 *             if the object can't be read from the stream
 * @throws ClassNotFoundException
 *             If a class cannot be found for the object to be read
 *
 * @see java.io.Serializable
 */
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {

    in.defaultReadObject();
    serializableMap = new HashMap<Class<?>, Serializer>();
    final Iterator<Serializer> i = serializerList.iterator();
    while (i.hasNext()) {
        final Serializer s = i.next();
        final Class<?> classes[] = s.getSerializableClasses();
        for (int j = 0; j < classes.length; j++) {
            serializableMap.put(classes[j], s);
        }
    }
}

From source file:org.proteosuite.FastScatterPlot.java

/**
 * Provides serialisation support.//from w w  w  .  j ava2s. 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();

    this.paint = SerialUtilities.readPaint(stream);
    this.domainGridlineStroke = SerialUtilities.readStroke(stream);
    this.domainGridlinePaint = SerialUtilities.readPaint(stream);

    this.rangeGridlineStroke = SerialUtilities.readStroke(stream);
    this.rangeGridlinePaint = SerialUtilities.readPaint(stream);

    if (this.domainAxis != null) {
        this.domainAxis.addChangeListener(this);
    }

    if (this.rangeAxis != null) {
        this.rangeAxis.addChangeListener(this);
    }
}

From source file:com.npower.dm.processor.BaseProcessor.java

/**
 * The readObject method is responsible for reading from the stream and restoring the classes fields,
 * and restore the transient fields./*www  .ja v a  2 s.c  om*/
 */
protected void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    log = LogFactory.getLog(BaseProcessor.class);

    in.defaultReadObject();
}

From source file:ArraySet.java

/**
 * Reconstitute the <tt>HashSet</tt> instance from a stream (that is,
 * deserialize it).//  w w w.ja  v a2  s .  c  o m
 */
@SuppressWarnings("unchecked")
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
    // Read in any hidden serialization magic
    s.defaultReadObject();
    int size = s.readInt();
    map = new ArrayMap<E, Object>(size);
    for (int i = 0; i < size; i++) {
        E e = (E) s.readObject();
        map.put(e, PRESENT);
    }
}

From source file:IntHashMap.java

/**
 * Reconstitutes the <code>IntHashMap</code> instance from a stream (i.e.,
 * deserialize it)./*  w w w  . j  av  a 2  s.  c  om*/
 *
 * @exception IOException
 * @exception ClassNotFoundException
 */
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
    // read in the threshold, loadfactor, and any hidden stuff
    s.defaultReadObject();

    // read in number of buckets and allocate the bucket array;
    int numBuckets = s.readInt();
    table = new Entry[numBuckets];

    // read in size (number of Mappings)
    int size = s.readInt();

    // read the keys and values, and put the mappings in the IntHashMap
    for (int i = 0; i < size; i++) {
        int key = s.readInt();
        Object value = s.readObject();
        put(key, value);
    }
}