Java Code Examples for java.io.ObjectInput#readBoolean()

The following examples show how to use java.io.ObjectInput#readBoolean() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
    throws IOException, ClassNotFoundException {

    // read the base class
    final double t = readBaseExternal(in);

    // read the local attributes
    scalingH      = in.readDouble();
    referenceTime = in.readDouble();

    final int n = (currentState == null) ? -1 : currentState.length;
    final boolean hasScaled = in.readBoolean();
    if (hasScaled) {
        scaled = new double[n];
        for (int j = 0; j < n; ++j) {
            scaled[j] = in.readDouble();
        }
    } else {
        scaled = null;
    }

    final boolean hasNordsieck = in.readBoolean();
    if (hasNordsieck) {
        nordsieck = (Array2DRowRealMatrix) in.readObject();
    } else {
        nordsieck = null;
    }

    if (hasScaled && hasNordsieck) {
        // we can now set the interpolated time and state
        stateVariation = new double[n];
        setInterpolatedTime(t);
    } else {
        stateVariation = null;
    }

}
 
Example 2
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);
    this.recursiveUnionReference = (SpliceOperation) in.readObject();
    if(in.readBoolean())
        rowMethodName=in.readUTF();
}
 
Example 3
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
    throws IOException, ClassNotFoundException {

    // read the base class
    final double t = readBaseExternal(in);

    // read the local attributes
    scalingH      = in.readDouble();
    referenceTime = in.readDouble();

    final int n = (currentState == null) ? -1 : currentState.length;
    final boolean hasScaled = in.readBoolean();
    if (hasScaled) {
        scaled = new double[n];
        for (int j = 0; j < n; ++j) {
            scaled[j] = in.readDouble();
        }
    } else {
        scaled = null;
    }

    final boolean hasNordsieck = in.readBoolean();
    if (hasNordsieck) {
        nordsieck = (Array2DRowRealMatrix) in.readObject();
    } else {
        nordsieck = null;
    }

    if (hasScaled && hasNordsieck) {
        // we can now set the interpolated time and state
        stateVariation = new double[n];
        setInterpolatedTime(t);
    } else {
        stateVariation = null;
    }

}
 
Example 4
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);
    if (in.readBoolean()) {
        result = in.readDouble();
    }
}
 
Example 5
Source Project: jdk8u_jdk   File: LiveRef.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static LiveRef read(ObjectInput in, boolean useNewFormat)
    throws IOException, ClassNotFoundException
{
    Endpoint ep;
    ObjID id;

    // Now read in the endpoint, id, and result flag
    // (need to choose whether or not to read old JDK1.1 endpoint format)
    if (useNewFormat) {
        ep = TCPEndpoint.read(in);
    } else {
        ep = TCPEndpoint.readHostPortFormat(in);
    }
    id = ObjID.read(in);
    boolean isResultStream = in.readBoolean();

    LiveRef ref = new LiveRef(id, ep, false);

    if (in instanceof ConnectionInputStream) {
        ConnectionInputStream stream = (ConnectionInputStream)in;
        // save ref to send "dirty" call after all args/returns
        // have been unmarshaled.
        stream.saveRef(ref);
        if (isResultStream) {
            // set flag in stream indicating that remote objects were
            // unmarshaled.  A DGC ack should be sent by the transport.
            stream.setAckNeeded();
        }
    } else {
        DGCClient.registerRefs(ep, Arrays.asList(new LiveRef[] { ref }));
    }

    return ref;
}
 
Example 6
Source Project: ignite   File: MetadataTypeArgs.java    License: Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
    boolean useName = in.readBoolean();

    if (useName)
        typeName = U.readString(in);
    else
        typeId = in.readInt();
}
 
Example 7
@Override
public void readExternal(ObjectInput in) throws IOException,
    ClassNotFoundException {
  System.out.println("VersionedHeader.readExternal invoked with " + in);
  if (in instanceof VersionedObjectInput) {
    this.serializedVersion = ((VersionedObjectInput)in).getVersion();
  } else {
    this.serializedVersion = Version.CURRENT;
  }
  in.readBoolean();
  in.readUTF();
}
 
Example 8
Source Project: gemfirexd-oss   File: TriggerDescriptor.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Read this object from a stream of stored objects.
 *
 * @param in read this.
 *
 * @exception IOException					thrown on error
 * @exception ClassNotFoundException		thrown on error
 */
public void readExternal(ObjectInput in)
	 throws IOException, ClassNotFoundException
{
	id = (UUID)in.readObject();
	name = (String)in.readObject();
	triggerSchemaId = (UUID)in.readObject();
	triggerTableId = (UUID)in.readObject();
	eventMask = in.readInt();
	isBefore = in.readBoolean();
	isRow = in.readBoolean();
	isEnabled = in.readBoolean();
	whenSPSId = (UUID)in.readObject();
	actionSPSId = (UUID)in.readObject();
	int length = in.readInt();
	if (length != 0)
	{
		referencedCols = new int[length];
		for (int i = 0; i < length; i++)
		{
			referencedCols[i] = in.readInt();
		}
	}
	triggerDefinition = (String)in.readObject();
	referencingOld = in.readBoolean();
	referencingNew = in.readBoolean();
	oldReferencingName = (String)in.readObject();
	newReferencingName = (String)in.readObject();
	
}
 
Example 9
public void readExternal(ObjectInput in) throws IOException,
                                        ClassNotFoundException {
    super.readExternal( in );
    this.className = ( String ) in.readObject();
    this.expr = ( String ) in.readObject();
    this.typesafe = in.readBoolean();
    this.evaluationContext = in.readObject();
}
 
Example 10
/**
  Read an array of integers from an ObjectInput. This allocates the
  array.

  @param	in	the ObjectInput.
  @return   the array of integers.

  @exception java.io.IOException The write caused an IOException. 
  */
public static int[] readIntArray(ObjectInput in) throws IOException {
	if (!in.readBoolean())
		return null;
	int length = in.readInt();
	int[] a = new int[length];
	for (int i=0; i<length; i++)
		a[i] = in.readInt();
	return a;
}
 
Example 11
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);
    source = (SpliceOperation) in.readObject();
    offsetMethodName = readNullableString(in);
    fetchFirstMethodName = readNullableString(in);
    hasJDBCLimitClause = in.readBoolean();
    bypass = in.readBoolean();
}
 
Example 12
Source Project: ignite   File: VisorHadoopConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
    planner = U.readString(in);
    extExecution = in.readBoolean();
    finishedJobInfoTtl = in.readLong();
    maxParallelTasks = in.readInt();
    maxTaskQueueSize = in.readInt();
    libNames = U.readList(in);
}
 
Example 13
Source Project: tomee   File: JNDIResponse.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
    final byte version = in.readByte(); // future use

    final boolean readServer = in.readBoolean();
    if (readServer) {
        server = new ServerMetaData();
        server.setMetaData(metaData);
        server.readExternal(in);
    }

    responseCode = in.readByte();

    switch (responseCode) {
        case ResponseCodes.JNDI_BUSINESS_OBJECT:
        case ResponseCodes.JNDI_OK:
        case ResponseCodes.JNDI_NAMING_EXCEPTION:
        case ResponseCodes.JNDI_RUNTIME_EXCEPTION:
        case ResponseCodes.JNDI_ERROR:
        case ResponseCodes.JNDI_RESOURCE:
            result = in.readObject();
            break;
        case ResponseCodes.JNDI_CONTEXT:
        case ResponseCodes.JNDI_NOT_FOUND:
            break;
        case ResponseCodes.JNDI_EJBHOME:
            final EJBMetaDataImpl m = new EJBMetaDataImpl();
            m.setMetaData(metaData);
            m.readExternal(in);
            result = m;
            break;
        case ResponseCodes.JNDI_DATA_SOURCE:
            final DataSourceMetaData ds = new DataSourceMetaData();
            ds.setMetaData(metaData);
            ds.readExternal(in);
            result = ds;
            break;
        case ResponseCodes.JNDI_INJECTIONS:
            final InjectionMetaData imd = new InjectionMetaData();
            imd.setMetaData(metaData);
            imd.readExternal(in);
            result = imd;
            break;
        case ResponseCodes.JNDI_WEBSERVICE:
            result = in.readObject();
            break;
        case ResponseCodes.JNDI_ENUMERATION:
            final NameClassPairEnumeration ncpe = new NameClassPairEnumeration();
            ncpe.setMetaData(metaData);
            ncpe.readExternal(in);
            result = ncpe;
            break;
        case ResponseCodes.JNDI_REFERENCE:
            result = in.readObject();
            break;
    }
}
 
Example 14
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);

    keepBinary = in.readBoolean();
}
 
Example 15
Source Project: reladomo   File: BooleanUpdateWrapper.java    License: Apache License 2.0 4 votes vote down vote up
public void readParameter(ObjectInput in) throws IOException, ClassNotFoundException
{
    this.newValue = in.readBoolean();
}
 
Example 16
Source Project: kogito-runtimes   File: NegConstraint.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    operator = in.readBoolean();
}
 
Example 17
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
		this.eliminatedNulls = in.readBoolean();
		this.isNull = in.readBoolean();
		this.sum = (BigDecimal)in.readObject();
}
 
Example 18
Source Project: ignite   File: IgfsBlockLocationImpl.java    License: Apache License 2.0 3 votes vote down vote up
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException {
    start = in.readLong();
    len = in.readLong();

    int size;

    if (in.readBoolean()) {
        size = in.readInt();

        nodeIds = new ArrayList<>(size);

        for (int i = 0; i < size; i++)
            nodeIds.add(U.readUuid(in));
    }

    size = in.readInt();

    names = new ArrayList<>(size);

    for (int i = 0; i < size; i++)
        names.add(in.readUTF());

    size = in.readInt();

    hosts = new ArrayList<>(size);

    for (int i = 0; i < size; i++)
        hosts.add(in.readUTF());
}
 
Example 19
Source Project: library   File: ConsensusMessage.java    License: Apache License 2.0 3 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {

    super.readExternal(in);

    number = in.readInt();
    epoch = in.readInt();
    paxosType = in.readInt();

    int toRead = in.readInt();

    if(toRead != -1) {

        value = new byte[toRead];

        do{

            toRead -= in.read(value, value.length-toRead, toRead);

        } while(toRead > 0);

    }

    boolean asProof = in.readBoolean();
    if (asProof) {
        
        proof = in.readObject();
    }
    
}
 
Example 20
/**
  Read an array of integers from an ObjectInput. This allocates the
  array.

  @param	in	the ObjectInput.
  @return   the array of integers.

  @exception java.io.IOException The write caused an IOException. 
  */
public static boolean[] readBooleanArray(ObjectInput in) throws IOException {
	int length = in.readInt();
	boolean[] a = new boolean[length];
	for (int i=0; i<length; i++)
		a[i] = in.readBoolean();
	return a;
}