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

The following examples show how to use java.io.ObjectInput#readInt() . 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
Source File: MemHeap.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * Restore the in-memory representation from the stream.
 *
 * @see  java.io.Externalizable#readExternal
 */
public void readExternal(ObjectInput in) throws IOException {

  // read the format id of this conglomerate.
  FormatIdUtil.readFormatIdInteger(in);

  int segmentid = in.readInt();
  long containerid = in.readLong();

  this.id = ContainerKey.valueOf(segmentid, containerid);

  // read the number of columns in the heap.
  int num_columns = in.readInt();

  // read the array of format ids.
  format_ids = ConglomerateUtil.readFormatIdArray(num_columns, in);
}
 
Example 2
Source File: SQLDate.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * @see java.io.Externalizable#readExternal
 *
 * @exception IOException	Thrown on error reading the object
 */
public void readExternal(ObjectInput in) throws IOException
{
   // GemStone changes BEGIN
   boolean isNull = in.readBoolean();
   if (isNull) {
     setToNull();
     return;
   }
   // GemStone changes END
   
	encodedDate = in.readInt();

	// reset cached string values
	valueString = null;
}
 
Example 3
Source File: XDistribution.java    From unitime with Apache License 2.0 6 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
	iDistributionId = in.readLong();
	iVariant = in.readInt();
	iType = XDistributionType.values()[in.readInt()];
	
	int nrOfferings = in.readInt();
	iOfferingIds.clear();
	for (int i = 0; i < nrOfferings; i++)
		iOfferingIds.add(in.readLong());
	
	int nrSections = in.readInt();
	iSectionIds.clear();
	for (int i = 0; i < nrSections; i++)
		iSectionIds.add(in.readLong());
}
 
Example 4
Source File: CCSMatrix.java    From hlta with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException,
            ClassNotFoundException {

    rows = in.readInt();
    columns = in.readInt();
    cardinality = in.readInt();

    int alignedSize = align(cardinality);

    values = new double[alignedSize];
    rowIndices = new int[alignedSize];
    columnPointers = new int[columns + 1];

    // read pairs (value, column index)
    for (int i = 0; i < cardinality; i++) {
        values[i] = in.readDouble();
        rowIndices[i] = in.readInt();
    }

    // read row pointers
    for (int i = 0; i < rows + 1; i++) {
        columnPointers[i] = in.readInt();
    }
}
 
Example 5
Source File: VisorPersistentStoreConfiguration.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
    persistenceStorePath = U.readString(in);
    checkpointingFreq = in.readLong();
    lockWaitTime = in.readLong();
    checkpointingPageBufSize = in.readLong();
    checkpointingThreads = in.readInt();
    walHistSize = in.readInt();
    walSegments = in.readInt();
    walSegmentSize = in.readInt();
    walStorePath = U.readString(in);
    walArchivePath = U.readString(in);
    metricsEnabled = in.readBoolean();
    walMode = WALMode.fromOrdinal(in.readByte());
    tlbSize = in.readInt();
    walFlushFreq = in.readLong();
    walFsyncDelay = in.readLong();
    walRecordIterBuffSize = in.readInt();
    alwaysWriteFullPages = in.readBoolean();
    subIntervals = in.readInt();
    rateTimeInterval = in.readLong();
}
 
Example 6
Source File: CursorInfo.java    From gemfirexd-oss with Apache License 2.0 6 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
{
	updateMode = in.readInt();
	targetTable = (ExecCursorTableReference)in.readObject();
	int len = ArrayUtil.readArrayLength(in);
	if (len != 0)
	{
		targetColumns = new ResultColumnDescriptor[len];
		ArrayUtil.readArrayItems(in, targetColumns);
	}
	len = ArrayUtil.readArrayLength(in);
	if (len != 0)
	{
		updateColumns = new String[len];
		ArrayUtil.readArrayItems(in, updateColumns);
	}
}
 
Example 7
Source File: MultiProbeDerbyScanInformation.java    From spliceengine with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
		super.readExternal(in);
		getProbeValsFuncName = SerializationUtils.readNullableString(in);
		sortRequired = in.readInt();
		inlistPosition = in.readInt();
		if (in.readBoolean()) {
			probeValues = new DataValueDescriptor[in.readInt()];
			for (int i = 0; i < probeValues.length; i++) {
				probeValues[i] = (DataValueDescriptor) in.readObject();
			}
		}
              probeValue = (DataValueDescriptor)in.readObject();
		inlistTypeArrayItem = in.readInt();

}
 
Example 8
Source File: IntArray.java    From spliceengine with GNU Affero General Public License v3.0 5 votes vote down vote up
public void readExternal( ObjectInput in ) throws IOException
{
    int length = in.readInt();

    _data = new int[ length ];

    for ( int i = 0; i < length; i++ ) { _data[ i ] = in.readInt(); }
}
 
Example 9
Source File: HashTableIterator.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
public void readExternal(ObjectInput in) throws IOException,
                                        ClassNotFoundException {
    hashTable = (AbstractHashTable) in.readObject();
    table = (Entry[]) in.readObject();
    row = in.readInt();
    length = in.readInt();
    entry = (Entry) in.readObject();
}
 
Example 10
Source File: RungeKuttaStepInterpolator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
  throws IOException {

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

  // read the local attributes
  final int n = (currentState == null) ? -1 : currentState.length;
  final int kMax = in.readInt();
  yDotK = (kMax < 0) ? null : new double[kMax][];
  for (int k = 0; k < kMax; ++k) {
    yDotK[k] = (n < 0) ? null : new double[n];
    for (int i = 0; i < n; ++i) {
      yDotK[k][i] = in.readDouble();
    }
  }

  integrator = null;

  if (currentState != null) {
      // we can now set the interpolated time and state
      setInterpolatedTime(t);
  } else {
      interpolatedTime = t;
  }

}
 
Example 11
Source File: TOTAL.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * Manual deserialization
 */
public void readExternal(ObjectInput in) throws IOException,
                                                ClassNotFoundException {
    type=in.readInt();
    localSequenceID=in.readLong();
    sequenceID=in.readLong();
}
 
Example 12
Source File: ClusterMemberImpl.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * The object implements the readExternal method to restore its contents by calling the methods of DataInput for
 * primitive types and readObject for objects, strings and arrays.  The readExternal method must read the values in
 * the same sequence and with the same types as were written by writeExternal.
 *
 * @param in the stream to read data from in order to restore the object
 * @throws IOException            if I/O errors occur
 * @throws ClassNotFoundException If the class for an object being restored cannot be found.
 */
public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {

   clusterName = in.readUTF();
   clusterMemberPort = in.readInt();
   final int size = in.readInt();
   clusterMemberAddresses = new ArrayList<ClusterMemberAddress>(size);
   for (int i = 0; i < size; i++) {

      final ClusterMemberAddress clusterMemberAddress = new ClusterMemberAddressImpl();
      clusterMemberAddress.readExternal(in);
      clusterMemberAddresses.add(clusterMemberAddress);
   }
}
 
Example 13
Source File: SparkLogicalOperator.java    From spliceengine with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    serializationVersion = in.readInt();
    logicalOpKind = in.readInt();
    if (logicalOpKind != AND && logicalOpKind != OR)
        throw new IOException();
    super.readExternal(in);
}
 
Example 14
Source File: MimeType.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
     * The object implements the readExternal method to restore its
     * contents by calling the methods of DataInput for primitive
     * types and readObject for objects, strings and arrays.  The
     * readExternal method must read the values in the same sequence
     * and with the same types as were written by writeExternal.
     * @exception ClassNotFoundException If the class for an object being
     *              restored cannot be found.
     */
    public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
        String s = in.readUTF();
        if (s == null || s.length() == 0) { // long mime type
            byte[] ba = new byte[in.readInt()];
            in.readFully(ba);
            s = new String(ba);
        }
        try {
            parse(s);
        } catch(MimeTypeParseException e) {
            throw new IOException(e.toString());
        }
    }
 
Example 15
Source File: IgfsFileMap.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    int size = in.readInt();

    if (size > 0) {
        ranges = new ArrayList<>(size);

        for (int i = 0; i < size; i++)
            ranges.add((IgfsFileAffinityRange)in.readObject());
    }
}
 
Example 16
Source File: RungeKuttaStepInterpolator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
  throws IOException {

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

  // read the local attributes
  final int n = (currentState == null) ? -1 : currentState.length;
  final int kMax = in.readInt();
  yDotK = (kMax < 0) ? null : new double[kMax][];
  for (int k = 0; k < kMax; ++k) {
    yDotK[k] = (n < 0) ? null : new double[n];
    for (int i = 0; i < n; ++i) {
      yDotK[k][i] = in.readDouble();
    }
  }

  integrator = null;

  if (currentState != null) {
      // we can now set the interpolated time and state
      setInterpolatedTime(t);
  } else {
      interpolatedTime = t;
  }

}
 
Example 17
Source File: LongArray.java    From FxDock with Apache License 2.0 4 votes vote down vote up
public void readExternal(ObjectInput in) throws ClassNotFoundException, IOException
{
	size = in.readInt();
	array = (long[])in.readObject();
}
 
Example 18
Source File: TriggerDescriptor.java    From spliceengine with GNU Affero General Public License v3.0 4 votes vote down vote up
/**
 * Read this object from a stream of stored objects.
 *
 * @param in read this.
 * @throws IOException            thrown on error
 * @throws ClassNotFoundException thrown on error
 */
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    Object obj;
    id = (UUID) in.readObject();
    name = (String) in.readObject();
    triggerSchemaId = (UUID) in.readObject();
    triggerTableId = (UUID) in.readObject();
    triggerDML = TriggerEventDML.fromId(in.readInt());
    isBefore = in.readBoolean();
    isRow = in.readBoolean();
    isEnabled = in.readBoolean();
    whenSPSId = (UUID) in.readObject();
    obj = in.readObject();
    if (obj instanceof UUID) {
        actionSPSIdList = new ArrayList<>();
        actionSPSIdList.add((UUID) obj);
    }
    int length = in.readInt();
    if (length != 0) {
        referencedCols = new int[length];
        for (int i = 0; i < length; i++) {
            referencedCols[i] = in.readInt();
        }
    }
    length = in.readInt();
    if (length != 0) {
        referencedColsInTriggerAction = new int[length];
        for (int i = 0; i < length; i++) {
            referencedColsInTriggerAction[i] = in.readInt();
        }
    }
    obj = in.readObject();
    if (obj instanceof String) {
        triggerDefinitionList = new ArrayList<>();
        triggerDefinitionList.add((String) obj);
    }
    referencingOld = in.readBoolean();
    referencingNew = in.readBoolean();
    oldReferencingName = (String) in.readObject();
    newReferencingName = (String) in.readObject();
    whenClauseText = (String) in.readObject();

}
 
Example 19
Source File: MapArray.java    From RipplePower with Apache License 2.0 4 votes vote down vote up
public void readExternal(final ObjectInput s) throws IOException, ClassNotFoundException {
	hashCode = s.readInt();
	key = s.readObject();
	value = s.readObject();
	next = (Entry) s.readObject();
}
 
Example 20
Source File: XStudent.java    From unitime with Apache License 2.0 4 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
	super.readExternal(in);
	
	int nrMajors = in.readInt();
	iMajors.clear();
	for (int i = 0; i < nrMajors; i++)
		iMajors.add(new XAreaClassificationMajor(in));
	
	int nrGroups = in.readInt();
	iGroups.clear();
	for (int i = 0; i < nrGroups; i++)
		iGroups.add(new XGroup(in));
	
	int nrAccomodations = in.readInt();
	iAccomodations.clear();
	for (int i = 0; i < nrAccomodations; i++)
		iAccomodations.add((String)in.readObject());
	
	int nrRequests = in.readInt();
	iRequests.clear();
	for (int i = 0; i < nrRequests; i++)
		iRequests.add(in.readBoolean() ? new XCourseRequest(in) : new XFreeTimeRequest(in));
	
	iStatus = (String)in.readObject();
	iEmail = (String)in.readObject();
	iEmailTimeStamp = (in.readBoolean() ? new Date(in.readLong()) : null);
	iLastStudentChange = (in.readBoolean() ? new Date(in.readLong()) : null);
	
	if (in.readBoolean())
		iLastNote = new XStudentNote(in);
	iAllowDisabled = in.readBoolean();
	
	int nrAdvisors = in.readInt();
	iAdvisors.clear();
	for (int i = 0; i < nrAdvisors; i++)
		iAdvisors.add(new XAdvisor(in));
	
	int nrAdvisorRequests = in.readInt();
	if (nrAdvisorRequests < 0) {
		iAdvisorRequests = null;
	} else {
		iAdvisorRequests = new ArrayList<XAdvisorRequest>(nrAdvisorRequests);
		for (int i = 0; i < nrAdvisorRequests; i++)
			iAdvisorRequests.add(new XAdvisorRequest(in));
	}
}