本文整理汇总了Java中com.google.common.io.ByteArrayDataInput.readDouble方法的典型用法代码示例。如果您正苦于以下问题:Java ByteArrayDataInput.readDouble方法的具体用法?Java ByteArrayDataInput.readDouble怎么用?Java ByteArrayDataInput.readDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.io.ByteArrayDataInput
的用法示例。
在下文中一共展示了ByteArrayDataInput.readDouble方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: constant
import com.google.common.io.ByteArrayDataInput; //导入方法依赖的package包/类
/**
* Reads a constant value at the given index, which must be one of CONSTANT_String_info,
* CONSTANT_Integer_info, CONSTANT_Float_info, CONSTANT_Long_info, or CONSTANT_Double_info.
*/
Const.Value constant(int index) {
ByteArrayDataInput reader = byteReader.seek(constantPool[index - 1]);
byte tag = reader.readByte();
switch (tag) {
case CONSTANT_LONG:
return new Const.LongValue(reader.readLong());
case CONSTANT_FLOAT:
return new Const.FloatValue(reader.readFloat());
case CONSTANT_DOUBLE:
return new Const.DoubleValue(reader.readDouble());
case CONSTANT_INTEGER:
return new Const.IntValue(reader.readInt());
case CONSTANT_STRING:
return new Const.StringValue(utf8(reader.readUnsignedShort()));
default:
throw new AssertionError(String.format("bad tag: %x", tag));
}
}
示例2: read
import com.google.common.io.ByteArrayDataInput; //导入方法依赖的package包/类
@Override
public void read(ByteArrayDataInput in) throws ProtocolException
{
// ------
// CLIENT
// ------
particleName = in.readUTF();
particlePosX = in.readDouble();
particlePosY = in.readDouble();
particlePosZ = in.readDouble();
velX = in.readDouble();
velY = in.readDouble();
velZ = in.readDouble();
}
示例3: recievePacket
import com.google.common.io.ByteArrayDataInput; //导入方法依赖的package包/类
@Override
public void recievePacket(ByteArrayDataInput data)
{
posX = data.readDouble();
posY = data.readDouble();
posZ = data.readDouble();
motionX = data.readDouble();
motionY = data.readDouble();
motionZ = data.readDouble();
rotationPitch = (float)data.readDouble();
rotationYaw = (float)data.readDouble();
prevRotationPitch = (float)data.readDouble();
prevRotationYaw = (float)data.readDouble();
}
示例4: recievePacket
import com.google.common.io.ByteArrayDataInput; //导入方法依赖的package包/类
@Override
public void recievePacket(ByteArrayDataInput data) {
posX = data.readDouble();
posY = data.readDouble();
posZ = data.readDouble();
motionX = data.readDouble();
motionY = data.readDouble();
motionZ = data.readDouble();
rotationPitch = (float)data.readDouble();
rotationYaw = (float)data.readDouble();
prevRotationPitch = (float)data.readDouble();
prevRotationYaw = (float)data.readDouble();
}