当前位置: 首页>>代码示例>>Java>>正文


Java ObjectInput.readObject方法代码示例

本文整理汇总了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();
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:18,代码来源:XCurriculumReservation.java

示例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);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:24,代码来源:StandardDialRangeTests.java

示例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 );
    }
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:25,代码来源:TCustomHashMap.java

示例4: readExternal

import java.io.ObjectInput; //导入方法依赖的package包/类
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // LIST
    list = ( TCharList ) in.readObject();
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:10,代码来源:TCharListDecorator.java

示例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();
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:12,代码来源:XRoom.java

示例6: readExternal

import java.io.ObjectInput; //导入方法依赖的package包/类
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // LIST
    list = ( TFloatList ) in.readObject();
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:10,代码来源:TFloatListDecorator.java

示例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);
    }
}
 
开发者ID:shibing624,项目名称:crf-seg,代码行数:14,代码来源:BaseNode.java

示例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()
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:ChronoZonedDateTimeImpl.java

示例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);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:ValueExpressionLiteral.java

示例10: readExternal

import java.io.ObjectInput; //导入方法依赖的package包/类
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // LIST
    list = ( TByteList ) in.readObject();
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:10,代码来源:TByteListDecorator.java

示例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();
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:12,代码来源:FunctionMapperImpl.java

示例12: readExternal

import java.io.ObjectInput; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);
    cats = (BitSet)in.readObject();
}
 
开发者ID:Luodian,项目名称:Higher-Cloud-Computing-Project,代码行数:6,代码来源:CategoricalRegionInfo.java

示例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());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:DatastoreSnapshot.java

示例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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:ChronoLocalDateTimeImpl.java

示例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();
}
 
开发者ID:Luodian,项目名称:Higher-Cloud-Computing-Project,代码行数:7,代码来源:PivotedVectorStorage.java


注:本文中的java.io.ObjectInput.readObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。