本文整理匯總了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.
}