本文整理汇总了Java中java.io.ObjectInput.readObject方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectInput.readObject方法的具体用法?Java ObjectInput.readObject怎么用?Java ObjectInput.readObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.ObjectInput
的用法示例。
在下文中一共展示了ObjectInput.readObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
iAcadArea = (String)in.readObject();
int nrClassifications = in.readInt();
iClassifications.clear();
for (int i = 0; i < nrClassifications; i++)
iClassifications.add((String)in.readObject());
int nrMajors = in.readInt();
iMajors.clear();
for (int i = 0; i < nrMajors; i++)
iMajors.add((String)in.readObject());
iLimit = in.readInt();
}
示例2: testSerialization
import java.io.ObjectInput; //导入方法依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
public void testSerialization() {
StandardDialRange r1 = new StandardDialRange();
StandardDialRange r2 = null;
try {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutput out = new ObjectOutputStream(buffer);
out.writeObject(r1);
out.close();
ObjectInput in = new ObjectInputStream(
new ByteArrayInputStream(buffer.toByteArray()));
r2 = (StandardDialRange) in.readObject();
in.close();
}
catch (Exception e) {
e.printStackTrace();
}
assertEquals(r1, r2);
}
示例3: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
public void readExternal( ObjectInput in )
throws IOException, ClassNotFoundException {
// VERSION
byte version = in.readByte();
// NOTE: super was not written in version 0
if ( version != 0 ) {
super.readExternal( in );
}
// NUMBER OF ENTRIES
int size = in.readInt();
setUp( size );
// ENTRIES
while ( size-- > 0 ) {
//noinspection unchecked
K key = (K) in.readObject();
//noinspection unchecked
V val = (V) in.readObject();
put( key, val );
}
}
示例4: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
public void readExternal( ObjectInput in )
throws IOException, ClassNotFoundException {
// VERSION
in.readByte();
// LIST
list = ( TCharList ) in.readObject();
}
示例5: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
iUniqueId = in.readLong();
iName = (String)in.readObject();
iExternalId = (String)in.readObject();
iIgnoreTooFar = in.readBoolean();
if (in.readBoolean()) {
iX = in.readDouble();
iY = in.readDouble();
}
}
示例6: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
public void readExternal( ObjectInput in )
throws IOException, ClassNotFoundException {
// VERSION
in.readByte();
// LIST
list = ( TFloatList ) in.readObject();
}
示例7: walkToLoad
import java.io.ObjectInput; //导入方法依赖的package包/类
protected void walkToLoad(ObjectInput byteArray) throws IOException, ClassNotFoundException {
c = byteArray.readChar();
status = ARRAY_STATUS[byteArray.readInt()];
if (status == Status.WORD_END_3 || status == Status.WORD_MIDDLE_2) {
value = (V) byteArray.readObject();
}
int childSize = byteArray.readInt();
child = new BaseNode[childSize];
for (int i = 0; i < childSize; ++i) {
child[i] = new Node<V>();
child[i].walkToLoad(byteArray);
}
}
示例8: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
static ChronoZonedDateTime<?> readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
ChronoLocalDateTime<?> dateTime = (ChronoLocalDateTime<?>) in.readObject();
ZoneOffset offset = (ZoneOffset) in.readObject();
ZoneId zone = (ZoneId) in.readObject();
return dateTime.atZone(offset).withZoneSameLocal(zone);
// TODO: ZDT uses ofLenient()
}
示例9: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
this.value = in.readObject();
String type = in.readUTF();
if (!"".equals(type)) {
this.expectedType = ReflectionUtil.forName(type);
}
}
示例10: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
public void readExternal( ObjectInput in )
throws IOException, ClassNotFoundException {
// VERSION
in.readByte();
// LIST
list = ( TByteList ) in.readObject();
}
示例11: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
this.prefix = in.readUTF();
if ("".equals(this.prefix))
this.prefix = null;
this.localName = in.readUTF();
this.owner = in.readUTF();
this.name = in.readUTF();
this.types = (String[]) in.readObject();
}
示例12: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
cats = (BitSet)in.readObject();
}
示例13: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
shardSnapshot = new ShardSnapshot((String)in.readObject(), (Snapshot) in.readObject());
}
示例14: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
static ChronoLocalDateTime<?> readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
ChronoLocalDate date = (ChronoLocalDate) in.readObject();
LocalTime time = (LocalTime) in.readObject();
return date.atTime(time);
}
示例15: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
sto = (VectorStorage)in.readObject();
pivot = (int[])in.readObject();
unpivot = (int[])in.readObject();
}