下面列出了java.io.ObjectInput#readBoolean ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/** {@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;
}
}
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
this.recursiveUnionReference = (SpliceOperation) in.readObject();
if(in.readBoolean())
rowMethodName=in.readUTF();
}
/** {@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;
}
}
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
if (in.readBoolean()) {
result = in.readDouble();
}
}
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;
}
/** {@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();
}
@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();
}
/**
* 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();
}
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();
}
/**
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;
}
@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();
}
/** {@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);
}
@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;
}
}
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
keepBinary = in.readBoolean();
}
public void readParameter(ObjectInput in) throws IOException, ClassNotFoundException
{
this.newValue = in.readBoolean();
}
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
operator = in.readBoolean();
}
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
this.eliminatedNulls = in.readBoolean();
this.isNull = in.readBoolean();
this.sum = (BigDecimal)in.readObject();
}
/** {@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());
}
@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();
}
}
/**
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;
}