本文整理汇总了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));
}
示例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());
}
}
示例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());
}
}
示例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 );
}
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}
示例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());
}