本文整理汇总了Java中java.io.ObjectOutputStream.writeShort方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectOutputStream.writeShort方法的具体用法?Java ObjectOutputStream.writeShort怎么用?Java ObjectOutputStream.writeShort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.ObjectOutputStream
的用法示例。
在下文中一共展示了ObjectOutputStream.writeShort方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doReps
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/**
* Run benchmark for given number of batches, with given number of cycles
* for each batch.
*/
void doReps(ObjectOutputStream oout, ObjectInputStream oin,
StreamBuffer sbuf, int nbatches, int ncycles)
throws Exception
{
for (int i = 0; i < nbatches; i++) {
sbuf.reset();
for (int j = 0; j < ncycles; j++) {
oout.writeShort(0);
}
oout.flush();
for (int j = 0; j < ncycles; j++) {
oin.readShort();
}
}
}
示例2: serialize
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/**
* See {@link GraphDBState#serialize(String)}.
*/
public void serialize(ObjectOutputStream objectOutputStream) throws IOException {
objectOutputStream.writeInt(size);
objectOutputStream.writeInt(neighbourIds.length);
objectOutputStream.writeInt(edgeTypes.length);
objectOutputStream.writeInt(edgeIds.length);
for (int i = 0; i < size; i++) {
objectOutputStream.writeInt(neighbourIds[i]);
objectOutputStream.writeShort(edgeTypes[i]);
objectOutputStream.writeLong(edgeIds[i]);
}
}
示例3: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream 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);
}
示例4: write
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
@Override
public final void write(ObjectOutputStream os, int[] indexes) throws IOException {
for (int index : indexes) {
final long value = getLong(index);
os.writeLong(value);
if (value != defaultValueAsLong) {
final short zoneId = zoneIds.get(index);
os.writeShort(zoneId);
}
}
}
示例5: write
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
@Override
public final void write(ObjectOutputStream os, int[] indexes) throws IOException {
for (int index : indexes) {
final int byteIndex = index * BYTE_COUNT;
final long epochMillis = byteBuffer.getLong(byteIndex);
final short zoneId = byteBuffer.getShort(byteIndex + 8);
os.writeLong(epochMillis);
os.writeShort(zoneId);
}
}
示例6: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/** Custom serialization */
private void writeObject(ObjectOutputStream os) throws IOException {
os.writeInt(length);
os.writeLong(defaultValueAsLong);
os.writeShort(defaultZoneId);
os.writeObject(defaultValue);
for (int i=0; i<length; ++i) {
final int byteIndex = i * BYTE_COUNT;
final long epochMillis = byteBuffer.getLong(byteIndex);
final short zoneId = byteBuffer.getShort(byteIndex + 8);
os.writeLong(epochMillis);
os.writeShort(zoneId);
}
}
示例7: write
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
@Override
public final void write(ObjectOutputStream os, int[] indexes) throws IOException {
for (int index : indexes) {
final long value = values[index];
os.writeLong(value);
if (value != defaultValueAsLong) {
os.writeShort(zoneIds[index]);
}
}
}
示例8: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/** Custom serialization */
private void writeObject(ObjectOutputStream os) throws IOException {
final int length = values.length;
os.writeInt(length);
os.writeLong(defaultValueAsLong);
os.writeObject(defaultValue);
for (int i=0; i<length; ++i) {
os.writeLong(values[i]);
os.writeShort(zoneIds[i]);
}
}
示例9: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream oos) throws IOException {
oos.writeShort(1);
}
示例10: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream oos) throws IOException {
oos.writeShort(2);
}