下面列出了java.io.ObjectInput#readInt ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* 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);
}
@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();
}
/**
* 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);
}
}
/** {@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();
}
@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();
}
}
@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());
}
/**
* @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;
}
/**
* 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());
}
}
/**
* 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);
}
}
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(); }
}
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();
}
/** {@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;
}
}
/**
* Manual deserialization
*/
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
type=in.readInt();
localSequenceID=in.readLong();
sequenceID=in.readLong();
}
@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);
}
/** {@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());
}
}
/** {@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;
}
}
public void readExternal(final ObjectInput s) throws IOException, ClassNotFoundException {
hashCode = s.readInt();
key = s.readObject();
value = s.readObject();
next = (Entry) s.readObject();
}
public void readExternal(ObjectInput in) throws ClassNotFoundException, IOException
{
size = in.readInt();
array = (long[])in.readObject();
}
/**
* 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();
}
@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));
}
}