Example usage for java.io ObjectInputStream readBoolean

List of usage examples for java.io ObjectInputStream readBoolean

Introduction

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

Prototype

public boolean readBoolean() throws IOException 

Source Link

Document

Reads in a boolean.

Usage

From source file:org.protempa.proposition.UniqueId.java

private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
    if (s.readBoolean()) {
        this.sourceId = DerivedSourceId.getInstance();
    } else {//from  w  w w  .j  a v a 2  s  . c  o m
        String id = (String) s.readObject();
        if (id == null) {
            throw new InvalidObjectException("Can't restore. Null id");
        }
        this.sourceId = DataSourceBackendId.getInstance(id);
    }
    this.localUniqueId = (LocalUniqueId) s.readObject();
}

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

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

From source file:org.sakaiproject.portal.render.portlet.services.state.PortletState.java

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

    id = in.readObject().toString();// w  ww.  j  a v a  2 s. com
    action = in.readBoolean();
    secure = in.readBoolean();
    parameters = (Map) in.readObject();
    portletMode = new PortletMode(in.readObject().toString());
    windowState = new WindowState(in.readObject().toString());

    if (LOG.isDebugEnabled()) {
        LOG.debug("Deserializing PortletState [action=" + action + "]");
    }

}

From source file:org.spout.api.inventory.ItemStack.java

private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    short matId = in.readShort();
    short matData = in.readShort();
    material = MaterialRegistry.get(matId);
    if (matData != 0 && material != null) {
        material = material.getSubMaterial(matData);
    }/*from  www  .  j a  va2  s. c  o  m*/
    amount = in.readInt();
    data = in.readShort();
    int auxDataSize = in.readInt();
    if (auxDataSize > 0) {
        byte[] auxData = new byte[auxDataSize];
        ManagedHashMap map = new ManagedHashMap();
        map.deserialize(auxData);
        this.auxData = map;
    }

    boolean hasNBTData = in.readBoolean();
    if (hasNBTData) {
        NBTInputStream is = new NBTInputStream(in, false);
        CompoundTag tag = (CompoundTag) is.readTag();
        nbtData = tag.getValue();
        is.close();
    }

    if (material == null) {
        throw new ClassNotFoundException("No material matching {" + matId + ", " + matData + "} was found!");
    }
}

From source file:pl.otros.logview.accept.query.org.apache.log4j.rule.MarkEqualsRule.java

/**
 * Deserialize the state of the object.//from w  ww  .ja v a2 s . c o m
 * 
 * @param in
 *          object input stream
 * @throws IOException
 *           if IO error during deserialization
 * @throws ClassNotFoundException
 *           if class not found during deserialization
 */
private void readObject(final java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
    useOnOffSwith = in.readBoolean();
    markerColors = (MarkerColors) in.readObject();
}

From source file:webplugin.WebAddress.java

public void readData(ObjectInputStream in) throws IOException, ClassNotFoundException {
    int version = in.readInt();

    mName = (String) in.readObject();
    mIconFileName = (String) in.readObject();

    if (version == 2 && mIconFileName != null) {
        File iconFile = new File(mIconFileName);

        if (iconFile.isFile()) {
            mIconFileName = iconFile.getName();
        } else {//from  w  ww  .j  a  v  a2  s. com
            mIconFileName = "";
        }
    }

    mUrl = (String) in.readObject();

    if (version == 1) {
        String encoding = (String) in.readObject();
        mUrl = mUrl.replaceAll("\\{0\\}", "{urlencode(title, \"" + encoding + "\")}");
    }
    mUserEntry = in.readBoolean();
    mActive = in.readBoolean();
}

From source file:xbird.engine.remote.RemoteFocus.java

@Deprecated
private int fetchAsyncStream() {
    final RemoteInputStream remoteIs;
    try {// w w w.  j av a2  s  .c  o m
        remoteIs = _proxy.asyncFetch(_fetchSize);
    } catch (RemoteException e) {
        throw new XQRemoteException(e);
    }
    final FastBufferedInputStream bufferedIs = new FastBufferedInputStream(remoteIs);
    final ObjectInputStream ois;
    try {
        ois = new ObjectInputStream(bufferedIs);
    } catch (IOException e) {
        throw new IllegalStateException(e);
    }
    int count = 0;
    try {
        while (true) {
            boolean hasmore = ois.readBoolean();
            if (!hasmore) {
                break;
            }
            ++count;
            Object ro = ois.readObject();
            Item fetched = (Item) ro;
            _fetchedQueue.offer(fetched);
            if (count == _fetchSize) {
                break;
            }
        }
    } catch (IOException ioe) {
        throw new XQRTException("failed to deserialize the fetched items", ioe);
    } catch (ClassNotFoundException cnf) {
        throw new XQRTException("failed to deserialize the fetched items", cnf);
    }
    return count;
}