Example usage for java.io ObjectInput readInt

List of usage examples for java.io ObjectInput readInt

Introduction

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

Prototype

int readInt() throws IOException;

Source Link

Document

Reads four input bytes and returns an int value.

Usage

From source file:gridool.dht.ops.RemoveOperation.java

public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    this.idxName = IOUtils.readString(in);
    int size = in.readInt();
    final byte[][] ary = new byte[size][];
    for (int i = 0; i < size; i++) {
        ary[i] = IOUtils.readBytes(in);//from   w w  w  .  j  ava 2  s  .co  m
    }
    this.keys = new ImmutableArrayList<byte[]>(ary);
    this.async = in.readBoolean();
}

From source file:gridool.dht.ops.MultiGetOperation.java

public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    this._idxName = IOUtils.readString(in);
    final int size = in.readInt();
    final byte[][] lkeys = new byte[size][];
    for (int i = 0; i < size; i++) {
        lkeys[i] = IOUtils.readBytes(in);
    }/*from  w w w .  j  a  v a  2s  . c  om*/
    this._keys = new ImmutableArrayList<byte[]>(lkeys);
}

From source file:xbird.util.collections.IndexedSet.java

@SuppressWarnings("unchecked")
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    final int size = in.readInt();
    final Map<E, Integer> map = new HashMap<E, Integer>(size);
    final ArrayList<E> list = new ArrayList<E>(size);
    for(int i = 0; i < size; i++) {
        E e = (E) in.readObject();/*  w w  w . j ava 2  s.  com*/
        list.add(e);
        map.put(e, i);
    }
    this._map = map;
    this._list = list;
}

From source file:org.spearce.jgit.transport.RemoteConfig.java

public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    name = in.readUTF();/*  ww w. ja v a 2  s.  c o  m*/
    final int items = in.readInt();
    Map<String, List<String>> map = new HashMap<String, List<String>>();
    for (int i = 0; i < items; i++) {
        String key = in.readUTF();
        String value = in.readUTF();
        List<String> values = map.get(key);
        if (null == values) {
            values = new ArrayList<String>();
            map.put(key, values);
        }
        values.add(value);
    }
    fromMap(map);
}

From source file:org.apache.ode.utils.NSContext.java

/**
 * @see Externalizable#readExternal(java.io.ObjectInput)
 */// w w  w . j a  v  a2s .co m
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    int numKeys = in.readInt();

    for (int i = 0; i < numKeys; ++i) {
        String prefix = in.readUTF();
        String uri = in.readUTF();
        _prefixToUriMap.put(prefix, uri);
    }

    if (__log.isTraceEnabled()) {
        __log.trace("readExternal: contents=" + _prefixToUriMap);
    }
}

From source file:gridool.dht.ops.AddOperation.java

public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    this.idxName = IOUtils.readString(in);
    final int size = in.readInt();
    final byte[][] lkeys = new byte[size][];
    final byte[][] lvalues = new byte[size][];
    for (int i = 0; i < size; i++) {
        lkeys[i] = IOUtils.readBytes(in);
        lvalues[i] = IOUtils.readBytes(in);
    }/*from  w  w w  .j av  a2  s  . co m*/
    this.keys = new ImmutableArrayList<byte[]>(lkeys);
    this.values = new ImmutableArrayList<byte[]>(lvalues);
    this.async = in.readBoolean();
}

From source file:com.splicemachine.derby.stream.compaction.SparkCompactionFunction.java

@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);
    smallestReadPoint = in.readLong();//from  w w  w. j a v  a  2  s.  c  om
    namespace = new byte[in.readInt()];
    in.readFully(namespace);
    tableName = new byte[in.readInt()];
    in.readFully(tableName);
    byte[] hriBytes = new byte[in.readInt()];
    in.readFully(hriBytes);
    try {
        hri = HRegionInfo.parseFrom(hriBytes);
    } catch (Exception e) {
        throw new IOException(e);
    }
    storeColumn = new byte[in.readInt()];
    in.readFully(storeColumn);
    SpliceSpark.setupSpliceStaticComponents();
}

From source file:org.apache.tapestry.engine.BaseEngine.java

/**
 *  Reconstructs the list of active page names
 *  written by {@link #writeExternal(ObjectOutput)}.
 * /*www . j  av a2 s  .  c  om*/
 **/

public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);

    int count = in.readInt();

    if (count > 0)
        _activePageNames = new HashSet(count);

    for (int i = 0; i < count; i++) {
        String name = in.readUTF();

        _activePageNames.add(name);
    }

}

From source file:org.ejbca.core.model.approval.approvalrequests.EditEndEntityApprovalRequest.java

public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);
    int version = in.readInt();
    if (version == 1) {
        newuserdata = (EndEntityInformation) in.readObject();
        clearpwd = in.readBoolean();/*from  ww  w  .  ja  v a  2 s .c o  m*/
        orguserdata = (EndEntityInformation) in.readObject();
    }
}

From source file:com.akop.bach.util.SerializableCookie.java

public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
    nullMask = in.readInt();

    String name = null;/* w  w  w .  j ava 2s. com*/
    String value = null;
    String comment = null;
    //String commentURL = null;
    Date expiryDate = null;
    //boolean isPersistent = false;
    String domain = null;
    String path = null;
    int[] ports = null;
    boolean isSecure = false;
    int version = 0;

    if ((nullMask & NAME) == 0)
        name = in.readUTF();

    if ((nullMask & VALUE) == 0)
        value = in.readUTF();

    if ((nullMask & COMMENT) == 0)
        comment = in.readUTF();

    if ((nullMask & COMMENT_URL) == 0)
        //commentURL =
        in.readUTF();

    if ((nullMask & EXPIRY_DATE) == 0)
        expiryDate = new Date(in.readLong());

    //isPersistent = 
    in.readBoolean();

    if ((nullMask & DOMAIN) == 0)
        domain = in.readUTF();

    if ((nullMask & PATH) == 0)
        path = in.readUTF();

    if ((nullMask & PORTS) == 0) {
        final int len = in.readInt();
        if (len < 10) {
            ports = new int[len];
            for (int i = 0; i < len; i++)
                ports[i] = in.readInt();
        }
    }

    isSecure = in.readBoolean();
    version = in.readInt();

    final BasicClientCookie bc = new BasicClientCookie(name, value);
    bc.setComment(comment);
    bc.setDomain(domain);
    bc.setExpiryDate(expiryDate);
    bc.setPath(path);
    bc.setSecure(isSecure);
    bc.setVersion(version);

    this.cookie = bc;
}