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


Java ObjectInput.readInt方法代码示例

本文整理汇总了Java中java.io.ObjectInput.readInt方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectInput.readInt方法的具体用法?Java ObjectInput.readInt怎么用?Java ObjectInput.readInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.io.ObjectInput的用法示例。


在下文中一共展示了ObjectInput.readInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readExternal

import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
	iUniqueId = in.readLong();
	iInstructionalType = (String)in.readObject();
	iName = (String)in.readObject();
	
	int nrSections = in.readInt();
	iSections.clear();
	for (int i = 0; i < nrSections; i++)
		iSections.add(new XSection(in));
	
	iConfigId = in.readLong();
	iParentId = in.readLong();
	if (iParentId < 0) iParentId = null;
	
	iCredit = (in.readBoolean() ? new XCredit(in) : null);
	
	iAllowOverlap = in.readBoolean();
	
	int nrCredits = in.readInt();
	iCreditByCourse.clear();
	for (int i = 0; i < nrCredits; i++)
		iCreditByCourse.put(in.readLong(), new XCredit(in));
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:25,代码来源:XSubpart.java

示例2: readExternal

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

    // VERSION
    in.readByte();

    // NO_ENTRY_VALUE
    no_entry_value = in.readShort();

    // ENTRIES
    int len = in.readInt();
    for (int i = 0; i < len; i++) {
        add(in.readShort());
    }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:17,代码来源:TShortLinkedList.java

示例3: readExternal

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

    // VERSION
    in.readByte();

    // NO_ENTRY_VALUE
    no_entry_value = in.readFloat();

    // ENTRIES
    int len = in.readInt();
    for (int i = 0; i < len; i++) {
        add(in.readFloat());
    }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:17,代码来源:TFloatLinkedList.java

示例4: readExternal

import java.io.ObjectInput; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
    oid = in.readUTF();
    criticality = in.readBoolean();

    if ( in.readBoolean() )
    {
        int valueLength = in.readInt();

        if ( valueLength > 0 )
        {
            value = new byte[valueLength];
            in.readFully( value );
        }
    }
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:21,代码来源:LdifControl.java

示例5: readUTF

import java.io.ObjectInput; //导入方法依赖的package包/类
/**
 *
 * Reads in a string that has been encoded using a modified UTF-8  format. The general contract of readUTF  is
 * that it reads a representation of a Unicode character string encoded in modified UTF-8 format; this string of
 * characters is then returned as a String.
 *
 * First, four bytes are read (readInt) and used to construct an unsigned 16-bit integer in exactly the manner
 * of the readUnsignedShort  method . This integer value is called the UTF length and specifies the number of
 * additional bytes to be read. These bytes are then converted to characters by considering them in groups. The
 * length of each group is computed from the value of the first byte of the group. The byte following a group, if
 * any, is the first byte of the next group.
 *
 *See also {@link java.io.DataInput#readUTF()}.
 *
 * @param objectInput The objectInput to read from
 * @return The read string
 * @throws java.io.IOException If the value can't be read
 */
public static String readUTF( ObjectInput objectInput ) throws IOException
{
    // Read length of the string
    int strLength = objectInput.readInt();

    // Start reading the string
    StringBuilder strBuf = new StringBuilder( objectInput.readUTF() );

    if ( ( strLength == 0 ) && ( "null".equals( strBuf.toString() ) ) ) 
    {
        // The special case of a 'null' string
        return null;
    }
    else
    {
        while ( strLength > strBuf.length() )
        {
            strBuf.append( objectInput.readUTF() );
        }
        return strBuf.toString();
    }
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:41,代码来源:Unicode.java

示例6: readExternal

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

	// VERSION
	in.readByte();

	// POSITION
	_pos = in.readInt();

	// NO_ENTRY_VALUE
	no_entry_value = in.readShort();

	// ENTRIES
	int len = in.readInt();
	_data = new short[ len ];
	for( int i = 0; i < len; i++ ) {
		_data[ i ] = in.readShort();
	}
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:20,代码来源:TShortArrayList.java

示例7: readExternal

import java.io.ObjectInput; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    parent = (Matrix)in.readObject();
    row = in.readInt();
    col = in.readInt();
    rowStride = in.readInt();
    colStride = in.readInt();

    size = getSize();
}
 
开发者ID:Luodian,项目名称:Higher-Cloud-Computing-Project,代码行数:11,代码来源:MatrixVectorStorage.java

示例8: readExternal

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

    // SUPER
	super.readExternal( in );

	// NO_ENTRY_KEY
	no_entry_key = in.readDouble();

	// NO_ENTRY_VALUE
	no_entry_value = in.readInt();
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:15,代码来源:TDoubleIntHash.java

示例9: readExternal

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

    // SUPER
	super.readExternal( in );

	// NO_ENTRY_KEY
	no_entry_key = in.readInt();

	// NO_ENTRY_VALUE
	no_entry_value = in.readFloat();
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:15,代码来源:TIntFloatHash.java

示例10: readExternal

import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);
    transactionId = TransactionIdentifier.readFrom(in);
    ready = in.readBoolean();
    totalMessagesSent = in.readInt();
    doCommitOnReady = in.readBoolean();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:9,代码来源:BatchedModifications.java

示例11: readExternal

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

    // SUPER
	super.readExternal( in );

	// NO_ENTRY_KEY
	no_entry_key = in.readShort();

	// NO_ENTRY_VALUE
	no_entry_value = in.readInt();
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:15,代码来源:TShortIntHash.java

示例12: readExternal

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

    int size = in.readInt();

    if (size > 1) {
        SerializationUtils.REUSABLE_READER_TL.set(NormalizedNodeInputOutput.newDataInputWithoutValidation(in));
    }

    try {
        for (int i = 0; i < size; i++) {
            byte type = in.readByte();
            switch (type) {
                case Modification.WRITE:
                    modifications.add(WriteModification.fromStream(in, getVersion()));
                    break;

                case Modification.MERGE:
                    modifications.add(MergeModification.fromStream(in, getVersion()));
                    break;

                case Modification.DELETE:
                    modifications.add(DeleteModification.fromStream(in, getVersion()));
                    break;
                default:
                    break;
            }
        }
    } finally {
        SerializationUtils.REUSABLE_READER_TL.remove();
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:34,代码来源:MutableCompositeModification.java

示例13: readExternal

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

    // SUPER
	super.readExternal( in );

	// NO_ENTRY_KEY
	no_entry_key = in.readLong();

	// NO_ENTRY_VALUE
	no_entry_value = in.readInt();
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:15,代码来源:TLongIntHash.java

示例14: readExternal

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

    // SUPER
	super.readExternal( in );

	// NO_ENTRY_KEY
	no_entry_key = in.readInt();

	// NO_ENTRY_VALUE
	no_entry_value = in.readLong();
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:15,代码来源:TIntLongHash.java

示例15: readExternal

import java.io.ObjectInput; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    size = in.readInt();

    allocateMemory(size);

    ptrInitHash = in.readInt();

    for (int i = 0; i < size; i++)
        set(i, in.readDouble());
}
 
开发者ID:Luodian,项目名称:Higher-Cloud-Computing-Project,代码行数:12,代码来源:DenseLocalOffHeapVectorStorage.java


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