本文整理汇总了Java中java.io.ObjectOutput.writeShort方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectOutput.writeShort方法的具体用法?Java ObjectOutput.writeShort怎么用?Java ObjectOutput.writeShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.ObjectOutput
的用法示例。
在下文中一共展示了ObjectOutput.writeShort方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
public void writeExternal( ObjectOutput out ) throws IOException {
// VERSION
out.writeByte( 0 );
// POSITION
out.writeInt( _pos );
// NO_ENTRY_VALUE
out.writeShort( no_entry_value );
// ENTRIES
int len = _data.length;
out.writeInt( len );
for( int i = 0; i < len; i++ ) {
out.writeShort( _data[ i ] );
}
}
示例2: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
// VERSION
out.writeByte( 1 );
// SUPER
super.writeExternal( out );
// NUMBER OF ENTRIES
out.writeInt( _size );
// LOAD FACTOR -- Added version 1
out.writeFloat( _loadFactor );
// NO ENTRY VALUE -- Added version 1
out.writeShort( no_entry_value );
// ENTRIES
for ( int i = _states.length; i-- > 0; ) {
if ( _states[i] == FULL ) {
out.writeShort( _set[i] );
}
}
}
示例3: marshalValue
import java.io.ObjectOutput; //导入方法依赖的package包/类
/**
* Marshal value to an ObjectOutput sink using RMI's serialization
* format for parameters or return values.
*/
protected static void marshalValue(Class<?> type, Object value,
ObjectOutput out)
throws IOException
{
if (type.isPrimitive()) {
if (type == int.class) {
out.writeInt(((Integer) value).intValue());
} else if (type == boolean.class) {
out.writeBoolean(((Boolean) value).booleanValue());
} else if (type == byte.class) {
out.writeByte(((Byte) value).byteValue());
} else if (type == char.class) {
out.writeChar(((Character) value).charValue());
} else if (type == short.class) {
out.writeShort(((Short) value).shortValue());
} else if (type == long.class) {
out.writeLong(((Long) value).longValue());
} else if (type == float.class) {
out.writeFloat(((Float) value).floatValue());
} else if (type == double.class) {
out.writeDouble(((Double) value).doubleValue());
} else {
throw new Error("Unrecognized primitive type: " + type);
}
} else {
out.writeObject(value);
}
}
示例4: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void writeExternal(ObjectOutput out) throws IOException {
// VERSION
out.writeByte(0);
// NO_ENTRY_VALUE
out.writeShort(no_entry_value);
// ENTRIES
out.writeInt(size);
for (TShortIterator iterator = iterator(); iterator.hasNext();) {
short next = iterator.next();
out.writeShort(next);
}
}
示例5: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
// VERSION
out.writeByte( 0 );
// SUPER
super.writeExternal( out );
// NO_ENTRY_KEY
out.writeLong( no_entry_key );
// NO_ENTRY_VALUE
out.writeShort( no_entry_value );
}
示例6: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
// VERSION
out.writeByte( 0 );
// SUPER
super.writeExternal( out );
// NO_ENTRY_KEY
out.writeChar( no_entry_key );
// NO_ENTRY_VALUE
out.writeShort( no_entry_value );
}
示例7: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
// VERSION
out.writeByte( 0 );
// SUPER
super.writeExternal( out );
// NO_ENTRY_KEY
out.writeShort( no_entry_key );
// NO_ENTRY_VALUE
out.writeShort( no_entry_value );
}
示例8: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
// VERSION
out.writeByte( 0 );
// SUPER
super.writeExternal( out );
// NO_ENTRY_KEY
out.writeShort( no_entry_key );
// NO_ENTRY_VALUE
out.writeByte( no_entry_value );
}
示例9: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
public void writeExternal(ObjectOutput out) throws IOException {
out.writeBoolean(z);
out.writeByte(b);
out.writeChar(c);
out.writeShort(s);
out.writeInt(i);
out.writeFloat(f);
out.writeLong(j);
out.writeDouble(d);
out.writeObject(str);
out.writeObject(parent);
out.writeObject(left);
out.writeObject(right);
}
示例10: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
// VERSION
out.writeByte( 0 );
// SUPER
super.writeExternal( out );
// NO_ENTRY_KEY
out.writeShort( no_entry_key );
// NO_ENTRY_VALUE
out.writeDouble( no_entry_value );
}
示例11: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
// VERSION
out.writeByte( 0 );
// SUPER
super.writeExternal( out );
// NO_ENTRY_KEY
out.writeShort( no_entry_key );
// NO_ENTRY_VALUE
out.writeInt( no_entry_value );
}
示例12: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
// VERSION
out.writeByte( 0 );
// SUPER
super.writeExternal( out );
// NO_ENTRY_KEY
out.writeShort( no_entry_key );
// NO_ENTRY_VALUE
out.writeLong( no_entry_value );
}
示例13: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
// VERSION
out.writeByte( 0 );
// SUPER
super.writeExternal( out );
// NO_ENTRY_KEY
out.writeDouble( no_entry_key );
// NO_ENTRY_VALUE
out.writeShort( no_entry_value );
}
示例14: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
// VERSION
out.writeByte( 0 );
// SUPER
super.writeExternal( out );
// NO_ENTRY_KEY
out.writeByte( no_entry_key );
// NO_ENTRY_VALUE
out.writeShort( no_entry_value );
}
示例15: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeByte(0); // version
out.writeUTF(type);
out.writeUTF(subType);
out.writeShort(0); // allow for more data.
}