Example usage for java.io ObjectInputStream readInt

List of usage examples for java.io ObjectInputStream readInt

Introduction

In this page you can find the example usage for java.io ObjectInputStream readInt.

Prototype

public int readInt() throws IOException 

Source Link

Document

Reads a 32 bit int.

Usage

From source file:DoubleList.java

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    int version = in.readInt();
    int len = in.readInt();
    data = new double[len];
    for (int i = 1; i < len; i++) {
        data[i] = in.readDouble();//  www  . j a  va  2  s .com
    }
    size = in.readInt();
}

From source file:org.protempa.proposition.value.ValueList.java

@SuppressWarnings("unchecked")
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
    int size = s.readInt();
    for (int i = 0; i < size; i++) {
        add((V) s.readObject());/*from   www.j  ava 2  s  .  c  om*/
    }
}

From source file:captureplugin.drivers.defaultdriver.ParamEntry.java

/**
 * Read Data from Stream/*  w ww.ja v a  2  s .co  m*/
 * @param in read data from this stream
 * @throws IOException read errors
 * @throws ClassNotFoundException problems while creating classes
 */
public void readData(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    int version = in.readInt();
    mName = (String) in.readObject();
    mParam = (String) in.readObject();

    mEnabled = version < 2 || in.readBoolean();
}

From source file:com.adobe.acs.commons.audit_log_search.impl.AuditLogSearchServlet.java

@SuppressWarnings("unchecked")
private JsonArray getModifiedProperties(ValueMap properties) throws IOException {
    JsonArray modifiedProperties = new JsonArray();
    InputStream is = properties.get("cq:properties", InputStream.class);
    if (is != null) {
        ObjectInputStream ois = new ObjectInputStream(is);
        ois.readInt();

        while (ois.available() != -1) {
            try {
                Object obj = ois.readObject();
                if (obj instanceof HashSet) {
                    Set<String> propertiesSet = (Set<String>) obj;
                    for (String property : propertiesSet) {
                        modifiedProperties.add(new JsonPrimitive(property));
                    }/* w w w . j  av  a  2 s.c o  m*/
                    break;
                }
            } catch (Exception e) {
                break;
            }
        }
    }
    return modifiedProperties;
}

From source file:net.sf.jasperreports.data.cache.StandardColumnCacheData.java

private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    int paramsCount = in.readInt();
    if (paramsCount > 0) {
        parameters = new LinkedHashMap<String, Object>(paramsCount * 4 / 3);
        for (int i = 0; i < paramsCount; i++) {
            String key = (String) in.readObject();
            Object value = in.readObject();
            parameters.put(key, value);//from   w  w  w.  jav  a 2s . c  om
        }
    }

    size = in.readInt();
    int fieldCount = in.readInt();
    fieldNames = new String[fieldCount];
    values = new ColumnValues[fieldCount];
    for (int i = 0; i < fieldCount; i++) {
        fieldNames[i] = (String) in.readObject();
        values[i] = (ColumnValues) in.readObject();
    }
}

From source file:org.spout.api.chat.style.ChatStyle.java

protected void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
    int id = ois.readInt();
    String key = ID_LOOKUP.getString(id);
    ChatStyle style = BY_NAME.get(key);/* w w w.ja  va 2 s  .  c  o m*/
    setField(ChatStyle.class, "id", id);
    setField(ChatStyle.class, "name", style.name);
    setField(ChatStyle.class, "lookupName", style.lookupName);

    System.out.println("Reading serialized chat style: " + getName());
}

From source file:com.hp.autonomy.hod.sso.HodAuthenticationPrincipal.java

private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();/*  w ww .  ja  v a 2 s .co m*/

    userMetadata = new HashMap<>();

    final int size = in.readInt();

    for (int i = 0; i < size; i++) {
        final String key = (String) in.readObject();
        final Serializable value = (Serializable) in.readObject();
        userMetadata.put(key, value);
    }
}

From source file:org.apache.openjpa.lib.util.ReferenceHashMap.java

protected void doReadObject(ObjectInputStream in) throws ClassNotFoundException, IOException {
    _maxSize = in.readInt();
    super.doReadObject(in);
}

From source file:org.bml.util.server.BProxyServer.java

public void processConnection(ObjectInputStream aIn, ObjectOutputStream aOut) {

    int myMethod = -1;
    try {// w ww.  j  a  v  a 2s  .c om
        myMethod = aIn.readInt();
    } catch (IOException e) {
        if (log.isWarnEnabled()) {
            log.warn("Error reading object method: " + e);
        }
        return;
    }

    if (myMethod == 666) {
        this.stopServer();
    } else if (myMethod == 0) {
        this.callMethodByName(aIn, aOut);
    }

    return;
}

From source file:org.protempa.proposition.value.OrdinalValue.java

private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
    this.val = (String) s.readObject();
    this.index = s.readInt();
}