本文整理汇总了Java中java.io.ObjectInputStream.readShort方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectInputStream.readShort方法的具体用法?Java ObjectInputStream.readShort怎么用?Java ObjectInputStream.readShort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.ObjectInputStream
的用法示例。
在下文中一共展示了ObjectInputStream.readShort方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doReps
import java.io.ObjectInputStream; //导入方法依赖的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: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException
{
z = in.readBoolean();
b = in.readByte();
c = in.readChar();
s = in.readShort();
i = in.readInt();
f = in.readFloat();
j = in.readLong();
d = in.readDouble();
str = (String) in.readObject();
parent = in.readObject();
left = in.readObject();
right = in.readObject();
}
示例3: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
/** Custom serialization */
private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException {
this.file = MappedArrayConstructor.randomFile(true);
this.length = is.readInt();
this.defaultValueAsLong = is.readLong();
this.defaultZoneId = is.readShort();
this.defaultValue = (ZonedDateTime)is.readObject();
this.channel = new RandomAccessFile(file, "rw").getChannel();
this.byteBuffer = channel.map(FileChannel.MapMode.READ_WRITE, 0, BYTE_COUNT * length);
for (int i=0; i<length; ++i) {
final int byteIndex = i * BYTE_COUNT;
final long epochMillis = is.readLong();
final short zoneId = is.readShort();
this.byteBuffer.putLong(byteIndex, epochMillis);
this.byteBuffer.putShort(byteIndex + 8, zoneId);
}
}
示例4: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
short version = ois.readShort();
switch(version) {
case 1:
this.updateLocalVarsFromCpdsProp();
this.setUpPropertyEvents();
return;
default:
throw new IOException("Unsupported Serialized Version: " + version);
}
}
示例5: deserialize
import java.io.ObjectInputStream; //导入方法依赖的package包/类
/**
* See {@link GraphDBState#deserialize(String)}.
*/
public void deserialize(ObjectInputStream objectInputStream) throws IOException,
ClassNotFoundException {
size = objectInputStream.readInt();
neighbourIds = new int[objectInputStream.readInt()];
edgeTypes = new short[objectInputStream.readInt()];
edgeIds = new long[objectInputStream.readInt()];
for (int i = 0; i < size; i++) {
neighbourIds[i] = objectInputStream.readInt();
edgeTypes[i] = objectInputStream.readShort();
edgeIds[i] = objectInputStream.readLong();
}
}
示例6: read
import java.io.ObjectInputStream; //导入方法依赖的package包/类
@Override
public final void read(ObjectInputStream is, int count) throws IOException {
for (int i=0; i<count; ++i) {
final long value = is.readLong();
this.values.put(i, value);
if (value != defaultValueAsLong) {
final short zoneId = is.readShort();
this.zoneIds.put(i, zoneId);
}
}
}
示例7: read
import java.io.ObjectInputStream; //导入方法依赖的package包/类
@Override
public final void read(ObjectInputStream is, int count) throws IOException {
for (int i=0; i<count; ++i) {
final int byteIndex = i * BYTE_COUNT;
final long epochMillis = is.readLong();
final short zoneId = is.readShort();
this.byteBuffer.putLong(byteIndex, epochMillis);
this.byteBuffer.putShort(byteIndex + 8, zoneId);
}
}
示例8: read
import java.io.ObjectInputStream; //导入方法依赖的package包/类
@Override
public final void read(ObjectInputStream is, int count) throws IOException {
for (int i=0; i<count; ++i) {
final long value = is.readLong();
this.values[i] = value;
if (value != defaultValueAsLong) {
this.zoneIds[i] = is.readShort();
}
}
}
示例9: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
/** Custom serialization */
private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException {
final int length = is.readInt();
this.values = new long[length];
this.zoneIds = new short[length];
this.defaultValueAsLong = is.readLong();
this.defaultValue = (ZonedDateTime)is.readObject();
for (int i=0; i<length; ++i) {
values[i] = is.readLong();
zoneIds[i] = is.readShort();
}
}
示例10: readObject
import java.io.ObjectInputStream; //导入方法依赖的package包/类
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
short version = ois.readShort();
switch (version) {
case 2:
return;
default:
throw new IOException("Unsupported Serialized Version: " + version);
}
}