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:net.sf.nmedit.jtheme.image.SVGImageResource.java

private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    initState();//from   www .j  a  va  2  s  .co  m
}

From source file:inflor.core.transforms.LogicleTransform.java

private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    this.logicle = new FastLogicle(t, w, m, a);
}

From source file:org.LexGrid.LexBIG.Impl.Extensions.GenericExtensions.search.SearchScoreDocIterator.java

@SuppressWarnings("unchecked")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {

    in.defaultReadObject();

    String inputString = (String) in.readObject();
    ByteArrayInputStream bais = new ByteArrayInputStream(Base64.decodeBase64(inputString));
    Input input = new Input(bais);
    Kryo kryo = new Kryo();
    kryo.setInstantiatorStrategy(new StdInstantiatorStrategy());
    UnmodifiableCollectionsSerializer.registerSerializers(kryo);
    SynchronizedCollectionsSerializer.registerSerializers(kryo);
    kryo.register(Arrays.asList("").getClass(), new ArraysAsListSerializer());
    kryo.register(ScoreDoc.class);
    List<ScoreDoc> queryObject = (List<ScoreDoc>) kryo.readClassAndObject(input);
    this.list = queryObject;
    ;//from  w  ww.j  av a  2 s .c  o m
    input.close();
}

From source file:uk.q3c.krail.core.guice.uiscope.UIScope.java

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    cache = new TreeMap<>();
    @SuppressWarnings("unchecked")
    Map<UIKey, Map<GuiceKeyProxy, Serializable>> proxyMap = (Map<UIKey, Map<GuiceKeyProxy, Serializable>>) in
            .readObject();/* w  ww  .  ja va 2 s  .  com*/
    for (Map.Entry<UIKey, Map<GuiceKeyProxy, Serializable>> entry : proxyMap.entrySet()) {
        Map<Key<?>, Object> cacheDetail = new HashMap<Key<?>, Object>();
        cache.put(entry.getKey(), cacheDetail);
        Map<GuiceKeyProxy, Serializable> sourceDetail = entry.getValue();
        for (Map.Entry<GuiceKeyProxy, Serializable> sourceDetailEntry : sourceDetail.entrySet()) {
            Object sourceDetailValue = sourceDetailEntry.getValue();
            Key<?> guiceKey = sourceDetailEntry.getKey().getKey();
            if (sourceDetailValue instanceof GuiceKeyProxy) {
                GuiceKeyProxy proxy = (GuiceKeyProxy) sourceDetailValue;
                cacheDetail.put(guiceKey, serializationSupport.getInjector().getInstance(proxy.getKey()));
            } else {
                Object value = SerializationUtils.deserialize((byte[]) sourceDetailEntry.getValue());
                cacheDetail.put(guiceKey, value);
            }

        }
    }
}

From source file:org.apache.hc.client5.http.impl.auth.BasicScheme.java

@SuppressWarnings("unchecked")
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    try {//from   w ww  . ja v a  2s .  c o  m
        this.charset = Charset.forName(in.readUTF());
    } catch (final UnsupportedCharsetException ex) {
        this.charset = StandardCharsets.US_ASCII;
    }
}

From source file:com.thinkbiganalytics.policy.standardization.DateTimeStandardizer.java

private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    initializeFormatters();//from  w  w w.  java  2 s  .co m
}

From source file:com.link_intersystems.lang.ref.AbstractSerializableReference.java

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    if (restoreInfo != null) {
        try {/*from  w ww  . j  a  v  a  2 s.c  o  m*/
            transientReferent = deserialize(restoreInfo);
        } catch (SerializationException e) {
            throw e;
        } catch (Exception e) {
            throw new SerializationException("Unable to deserialize object reference", e);
        }
    }
}

From source file:org.eclipse.ecr.runtime.api.ServiceHost.java

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    int len = in.readInt();
    String[] ar = new String[len];
    for (int i = 0; i < len; i++) {
        ar[i] = (String) in.readObject();
    }//from   w ww.j  a  v  a  2 s. com
    setGroups(ar);
}

From source file:org.pentaho.reporting.engine.classic.core.filter.DrawableLoadFilter.java

/**
 * A helper method that is called during the de-serialization process.
 *
 * @param in//www.  ja  va2s . c o m
 *          the serialization input stream.
 * @throws IOException
 *           if an IOError occurs.
 * @throws ClassNotFoundException
 *           if a dependent class cannot be found.
 */
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    failureCache = new HashSet<String>();
}

From source file:ConcurrentHashSet.java

/**
 * Re-constitute the <tt>HashSet</tt> instance from a stream.
 * //from w  ww  .  jav a  2  s .c  o m
 * @param inputStream
 * @throws ClassNotFoundException
 * @throws IOException
 */
private void readObject(ObjectInputStream inputStream) throws ClassNotFoundException, IOException {
    inputStream.defaultReadObject();

    map = new ConcurrentHashMap<E, Object>();

    int size = inputStream.readInt();
    for (int i = 0; i < size; i++) {
        E e = (E) inputStream.readObject();
        map.put(e, PRESENT);
    }
}