本文整理汇总了Java中io.netty.buffer.ByteBuf.readDouble方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBuf.readDouble方法的具体用法?Java ByteBuf.readDouble怎么用?Java ByteBuf.readDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.netty.buffer.ByteBuf
的用法示例。
在下文中一共展示了ByteBuf.readDouble方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void deserialize(ByteBuf buf) {
int rows = buf.readInt();
int cols = buf.readInt();
result = new double[rows][cols];
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
result[i][j] = buf.readDouble();
}
}
int infoSize = buf.readInt();
partInfo = new int[infoSize];
for (int i = 0; i < infoSize; i++) {
partInfo[i] = buf.readInt();
}
}
示例2: updateDoubleDenseToDoubleDense
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
public void updateDoubleDenseToDoubleDense(int size, ByteBuf buf, ServerDenseDoubleRow row,
int compressRatio) {
int bitPerItem = 8 * 8 / compressRatio;
DoubleBuffer data = row.getData();
LOG.debug("update double to double, size: " + size);
if (size <= 0)
return;
double maxAbs = buf.readDouble();
int maxPoint = (int) Math.pow(2, bitPerItem - 1) - 1;
for (int i = 0; i < size - 1; i++) {
byte[] itemBytes = new byte[bitPerItem / 8];
buf.readBytes(itemBytes);
int point = byteArray2int(itemBytes);
double parsedValue = (double) point / (double) maxPoint * maxAbs;
data.put(i, data.get(i) + parsedValue);
}
LOG.info(String.format("parse compressed %d double data, max abs: %f, max point: %d", size - 1,
maxAbs, maxPoint));
}
示例3: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
mana = buf.readInt();
maxMana = buf.readInt();
manaPerSecond = buf.readInt();
magicalPower = buf.readDouble();
healthPerSecond = buf.readInt();
criticalChance = buf.readDouble();
criticalDamage = buf.readDouble();
}
示例4: deserialize
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void deserialize(ByteBuf buf) {
int resultSize = buf.readInt();
result = new double[resultSize];
for (int i = 0; i < resultSize; i++) {
result[i] = buf.readDouble();
}
int colSize = buf.readInt();
cols = new long[colSize];
for (int i = 0; i < colSize; i++) {
cols[i] = buf.readLong();
}
}
示例5: deserialize
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void deserialize(ByteBuf buf) {
super.deserialize(buf);
int rowLength = buf.readInt();
this.rowIds = new int[rowLength];
for (int i = 0; i < rowLength; i++) {
this.rowIds[i] = buf.readInt();
}
int scalarLength = buf.readInt();
this.scalars = new double[scalarLength];
for (int i = 0; i < scalarLength; i++) {
this.scalars[i] = buf.readDouble();
}
}
示例6: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
// the order is important
this.entityID = buf.readInt();
this.posX = buf.readDouble();
this.posY = buf.readDouble();
this.posZ = buf.readDouble();
}
示例7: deserialize
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void deserialize(ByteBuf buf) {
super.deserialize(buf);
rowId = buf.readInt();
int length = buf.readInt();
array = new double[length];
for (int i = 0; i < length; i++) {
array[i] = buf.readDouble();
}
}
示例8: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
from = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble());
to = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble());
toCosmetic = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble());
anima = AnimaStack.readFromBuf(buf);
spawnParticles = buf.readBoolean();
}
示例9: deserialize
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void deserialize(ByteBuf buf) {
partKey = new PartitionKey();
partKey.deserialize(buf);
int len = buf.readInt();
values = new double[len];
for (int i = 0; i < len; i++) {
values[i] = buf.readDouble();
}
}
示例10: readSpawnData
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void readSpawnData(ByteBuf additionalData) // read it on the client
{
this.ownerX = additionalData.readDouble();
this.ownerY = additionalData.readDouble();
this.ownerZ = additionalData.readDouble();
}
示例11: read
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void read( ByteBuf buf ) throws IOException {
x = buf.readDouble();
y = buf.readDouble();
z = buf.readDouble();
onGround = buf.readBoolean();
}
示例12: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
this.x = buf.readDouble();
this.y = buf.readDouble();
this.z = buf.readDouble();
this.yaw = buf.readFloat();
this.pitch = buf.readFloat();
this.setX = buf.readBoolean();
this.setY = buf.readBoolean();
this.setZ = buf.readBoolean();
this.setYaw = buf.readBoolean();
this.setPitch = buf.readBoolean();
}
示例13: read
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void read( ByteBuf buf ) throws IOException {
x = buf.readDouble();
y = buf.readDouble();
z = buf.readDouble();
yaw = buf.readFloat();
pitch = buf.readFloat();
onGround = buf.readBoolean();
}
示例14: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
void fromBytes(ByteBuf dat)
{
super.fromBytes(dat);
modId = ByteBufUtils.readUTF8String(dat);
modEntityTypeId = dat.readInt();
entityUUID = new UUID(dat.readLong(), dat.readLong());
rawX = dat.readDouble();
rawY = dat.readDouble();
rawZ = dat.readDouble();
scaledYaw = dat.readByte() * 360F / 256F;
scaledPitch = dat.readByte() * 360F / 256F;
scaledHeadYaw = dat.readByte() * 360F / 256F;
try
{
dataWatcherList = EntityDataManager.readEntries(new PacketBuffer(dat));
} catch (IOException e)
{
FMLLog.log(Level.FATAL, e, "There was a critical error decoding the datawatcher stream for a mod entity.");
throw Throwables.propagate(e);
}
throwerId = dat.readInt();
if (throwerId != 0)
{
speedScaledX = dat.readInt() / 8000D;
speedScaledY = dat.readInt() / 8000D;
speedScaledZ = dat.readInt() / 8000D;
}
this.dataStream = dat;
}
示例15: decode
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void decode(ByteBuf buf) {
this.freeRam = buf.readLong();
this.cpuLoad = buf.readDouble();
}