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